Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 14216 invoked from network); 29 Jul 2009 15:52:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Jul 2009 15:52:04 -0000 Received: (qmail 23447 invoked by uid 500); 29 Jul 2009 15:52:04 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 23407 invoked by uid 500); 29 Jul 2009 15:52:04 -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 23389 invoked by uid 99); 29 Jul 2009 15:52:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jul 2009 15:52:03 +0000 X-ASF-Spam-Status: No, hits=1.1 required=10.0 tests=FORGED_HOTMAIL_RCVD2,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jul 2009 15:51:54 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MWBRF-00053E-T9 for users@camel.apache.org; Wed, 29 Jul 2009 08:51:33 -0700 Message-ID: <24722130.post@talk.nabble.com> Date: Wed, 29 Jul 2009 08:51:33 -0700 (PDT) From: msjwhite To: users@camel.apache.org Subject: Simple language checks failing after split MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: marksjwhite@hotmail.com X-Virus-Checked: Checked by ClamAV on apache.org I have the following route which takes an input message (with header type="INPUT") and splits it into two (with header type="TYPE1" and "TYPE2"), after which a choice is used to route it to the appropriate endpoint based on a 'type' header value set in the splitter. When using the expression in the choice it is evaluating the original message in each case and not split one and hence checks fail and I send to error queue. When using the same check in an equivalent expression it is correctly evaluating the split message in each case and so correctly routes to the out queues. ${header.type} == 'TYPE1' ${header.type} == 'TYPE2' Here is my log and tracer output when using checks (I added a little extra debug output into PredicateBuilder to show what it is exactly comparing); INFO [RouteTest ] - Expected message count OUT_QUEUE_1=1, OUT_QUEUE_2=1, ERROR=0 INFO [RouteTest ] - Sent exchange: Exchange[Message: ] INFO [Logger ] - ID-mswxp2-2741-1248881378187-2-0 >>> jms:IN_QUEUE --> split(), Pattern:InOnly, Headers:{JMSXGroupID=null, JMSCorrelationID=null, JMSType=null, JMSExpiration=0, JMSMessageID=ID:mswxp2-2739-1248881377921-0:4:1:1:1, JMSRedelivered=false, JMSDeliveryMode=2, JMSPriority=4, type=INPUT, JMSReplyTo=null, JMSTimestamp=1248881378765, JMSDestination=queue://IN_QUEUE}, BodyType:String, Body: INFO [Logger ] - ID-mswxp2-2741-1248881378187-2-0 >>> split() --> split(), Pattern:InOnly, Headers:{CamelMulticastIndex=0, CamelSplitSize=2, type=TYPE1, CamelSplitIndex=0}, BodyType:String, Body: TRACE [PredicateBuilder$6 ] - matches(INPUT==TYPE1) TRACE [PredicateBuilder$6 ] - matches(INPUT==TYPE2) INFO [Logger ] - ID-mswxp2-2741-1248881378187-2-0 >>> split() --> otherwise(jms:ERROR), Pattern:InOnly, Headers:{CamelMulticastIndex=0, CamelSplitSize=2, type=TYPE1, CamelSplitIndex=0}, BodyType:String, Body: INFO [Logger ] - ID-mswxp2-2741-1248881378187-2-0 >>> otherwise(jms:ERROR) --> split(), Pattern:InOnly, Headers:{CamelMulticastIndex=1, CamelSplitSize=2, type=TYPE2, CamelSplitIndex=1}, BodyType:String, Body: TRACE [PredicateBuilder$6 ] - matches(INPUT==TYPE1) TRACE [PredicateBuilder$6 ] - matches(INPUT==TYPE2) INFO [Logger ] - ID-mswxp2-2741-1248881378187-2-0 >>> split() --> otherwise(jms:ERROR), Pattern:InOnly, Headers:{CamelMulticastIndex=1, CamelSplitSize=2, type=TYPE2, CamelSplitIndex=1}, BodyType:String, Body: INFO [RouteTest ] - Got message count OUT_QUEUE_1=0, OUT_QUEUE_2=0, ERROR=2 and here is the same test when using checks; INFO [RouteTest ] - Expected message count OUT_QUEUE_1=1, OUT_QUEUE_2=1, ERROR=0 INFO [RouteTest ] - Sent exchange: Exchange[Message: ] INFO [Logger ] - ID-mswxp2-2801-1248882234296-2-0 >>> jms:IN_QUEUE --> split(), Pattern:InOnly, Headers:{JMSXGroupID=null, JMSCorrelationID=null, JMSType=null, JMSExpiration=0, JMSMessageID=ID:mswxp2-2799-1248882234046-0:4:1:1:1, JMSRedelivered=false, JMSDeliveryMode=2, JMSPriority=4, type=INPUT, JMSReplyTo=null, JMSTimestamp=1248882234890, JMSDestination=queue://IN_QUEUE}, BodyType:String, Body: INFO [Logger ] - ID-mswxp2-2801-1248882234296-2-0 >>> split() --> split(), Pattern:InOnly, Headers:{CamelMulticastIndex=0, CamelSplitSize=2, type=TYPE1, CamelSplitIndex=0}, BodyType:String, Body: INFO [Logger ] - ID-mswxp2-2801-1248882234296-2-0 >>> split() --> when(request.headers.get('type') == 'TYPE1'), Pattern:InOnly, Headers:{CamelMulticastIndex=0, CamelSplitSize=2, type=TYPE1, CamelSplitIndex=0}, BodyType:String, Body: INFO [Logger ] - ID-mswxp2-2801-1248882234296-2-0 >>> when(request.headers.get('type') == 'TYPE1') --> split(), Pattern:InOnly, Headers:{CamelMulticastIndex=1, CamelSplitSize=2, type=TYPE2, CamelSplitIndex=1}, BodyType:String, Body: INFO [Logger ] - ID-mswxp2-2801-1248882234296-2-0 >>> split() --> when(request.headers.get('type') == 'TYPE2'), Pattern:InOnly, Headers:{CamelMulticastIndex=1, CamelSplitSize=2, type=TYPE2, CamelSplitIndex=1}, BodyType:String, Body: INFO [RouteTest ] - Got message count OUT_QUEUE_1=1, OUT_QUEUE_2=1, ERROR=0 This is causing us to not be able to use the Simple language header checking, which is a shame because of the simplicity and the performance benefits it provides. Am I doing something dumb here, or does this look like an issue I should raise? I'm using 2.0-M2, btw. Thanks Mark -- View this message in context: http://www.nabble.com/Simple-language-checks-failing-after-split-tp24722130p24722130.html Sent from the Camel - Users mailing list archive at Nabble.com.