Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 18913 invoked from network); 25 Mar 2011 11:37:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Mar 2011 11:37:25 -0000 Received: (qmail 9784 invoked by uid 500); 25 Mar 2011 11:37:24 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 9756 invoked by uid 500); 25 Mar 2011 11:37:24 -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 9744 invoked by uid 99); 25 Mar 2011 11:37:24 -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 11:37:24 +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.180 as permitted sender) Received: from [209.85.216.180] (HELO mail-qy0-f180.google.com) (209.85.216.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Mar 2011 11:37:20 +0000 Received: by qyk10 with SMTP id 10so685748qyk.11 for ; Fri, 25 Mar 2011 04:36:59 -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=XBey0wKxJRp4Oxhlxk9TTa39YZKLVfZzCBt1pPgWM+Q=; b=xtS/wcoqIAylTRwGtLqJUCnGjenu7LU10b9KliP4Cq481vZuYGjH0fI22N4Lp8irY9 5oFllxSRSFI3U0UcqmFL+gFHL7+xSP5L7y7dL3fX78mlN4hTWFB7AP/pxy8GZlititqm L/QEyyU8nbYa6Ig8D5MkTOOSTanZCw2cVL02s= 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=aIRD+oCJdADvZ2V/VQoTZPP2vNd6Q4BU8ra5dnqnwx8F/uKlDP61ZZ5vjrYQvSXtfY XAKbHHTD0u0Sje6PNmDtR254v9kXiFSIf5GQaVJZ0wwtN1g7EaBFt8Q2kygCbWjsjitb xn6OL9zsLbDNZ58MMAJJ1onIDs89gqrrsxwVs= Received: by 10.229.130.168 with SMTP id t40mr519040qcs.140.1301053018133; Fri, 25 Mar 2011 04:36:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.247.75 with HTTP; Fri, 25 Mar 2011 04:36:38 -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 12:36:38 +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 11:44 AM, Claus Ibsen wrote= : > 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. > I was a bit vague here when referring to not a bug, which was the CAMEL-3554 I was referring to. Indeed the JmsMessage would re-initialize the underlying JMS message if you set the message body to null. As it would think it wasn't initialized. So I have created a ticket to track that https://issues.apache.org/jira/browse/CAMEL-3805 > > > >> 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. >>>> >>> >> > > > > -- > 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/ > --=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/