Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 34270 invoked from network); 25 Mar 2011 10:45:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Mar 2011 10:45:27 -0000 Received: (qmail 35783 invoked by uid 500); 25 Mar 2011 10:45:27 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 35730 invoked by uid 500); 25 Mar 2011 10:45:26 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 35722 invoked by uid 99); 25 Mar 2011 10:45:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Mar 2011 10:45:26 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.216.45 as permitted sender) Received: from [209.85.216.45] (HELO mail-qw0-f45.google.com) (209.85.216.45) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Mar 2011 10:45:22 +0000 Received: by qwj8 with SMTP id 8so598325qwj.32 for ; Fri, 25 Mar 2011 03:45:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=FCVXlWQUBrFCOLcwEBlbG+zcHGmJC1S8bPiFFT4lNI8=; b=pdG83AucHk3Eb9hKXdqZCeimMN7PgKFcSe6PbJG7QGSP/vOhdzk7ShRv+9PSiQ0zfT wDK0C30/PRC9acpuDN+rr9QO3eBN9bU5P6er5gdsjCRSeS9ZEuIZ+l2qgBzYJGo5X8/Q 2l4m9ag2jZq7VY2UD0jNNt7UvNUPZt1MmWmV4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=vtCPifkYDnhJOB+8DkPmKWyW47xMM5XvNwy2Bq76WEmtQya6A0uPcULhuuf8IwPCuR 9iau3ml4I7Ka6dr8GaldrmCvyz2JR/1gXFOX1SwAlG3AfLhVMUlikuHWFCQZmLfoNLOE WxItrL8bWXwl3FPzL7lb7KwMsc5iD1nqQUIe0= Received: by 10.229.102.209 with SMTP id h17mr454564qco.102.1301049902114; Fri, 25 Mar 2011 03:45:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.247.75 with HTTP; Fri, 25 Mar 2011 03:44:42 -0700 (PDT) In-Reply-To: References: <1300914833654-4259599.post@n5.nabble.com> <4D8AF539.7010508@gmail.com> <1301005391184-4263203.post@n5.nabble.com> From: Claus Ibsen Date: Fri, 25 Mar 2011 11:44:42 +0100 Message-ID: Subject: Re: choice when check BodyType:null, Body:null To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Mar 25, 2011 at 3:42 AM, Tim wrote: > so based on the cause of that bug, it is impossible to set the body of > a jms message to null even if it was transformed earlier. > So for example if you had: > Its not a bug, thats how it was designed. Its very unusual to route null messages. You should most likely be able to do a exchange.setIn(new DefaultMessage()); Or something like that to work around your issue. > jmsmessage (a) -> bean which returns (b) based on that message -> bean > c which returned null based on b -> bean d.. d would get (a) again. > (note that it doesn't even get b which was after a). > > On Thu, Mar 24, 2011 at 9:38 PM, Tim wrote: >> I believe you ran into https://issues.apache.org/jira/browse/CAMEL-3354 >> >> On Thu, Mar 24, 2011 at 5:23 PM, Eric East wrote: >>> Thanks for response. >>> >>> I narrowed down my test case where I see the issue. >>> >>> When I initiate a route using a jms activeMQ broker (internal VM), the >>> exchange.setBody(null) does not set the body to null. >>> >>> I am using Camel 2.5. =A0Actvemq 5.4.1 >>> >>> >>> TEST CASE FAILS: >>> template.sendBody("activemqVM:topic:tlm", SomeObject); >>> from("activemqVM:topic:tlm").to("direct:one") >>> >>> TEST CASE WORKS: >>> template.sendBody("direct:one", SomeObject); >>> >>> >>> ROUTE >>> from("direct:one") >>> .log("processing ${in.body}") >>> .process(new Processor(){ >>> =A0 =A0 =A0 =A0public void process(Exchange exchange)throws Exception{ >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0exchange.getIn().setBody(null); >>> =A0 =A0 =A0 =A0} >>> }) >>> .log("new body: [${in.body}]") >>> .choice() >>> =A0 =A0 =A0 =A0.when().simple("${in.body} !=3D null") >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.log(" !=3D null") >>> =A0 =A0 =A0 =A0.otherwise() >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.log(" =3D=3D null"); >>> >>> --Eric >>> >>> >>> >>> -- >>> View this message in context: http://camel.465427.n5.nabble.com/choice-= when-check-BodyType-null-Body-null-tp4259599p4263203.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> >> > --=20 Claus Ibsen ----------------- FuseSource Email: cibsen@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/