Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E041810B60 for ; Tue, 8 Oct 2013 04:26:31 +0000 (UTC) Received: (qmail 10360 invoked by uid 500); 8 Oct 2013 04:25:09 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 10276 invoked by uid 500); 8 Oct 2013 04:25:01 -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 10234 invoked by uid 99); 8 Oct 2013 04:24:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 04:24:51 +0000 X-ASF-Spam-Status: No, hits=3.8 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kraythe@gmail.com designates 74.125.82.177 as permitted sender) Received: from [74.125.82.177] (HELO mail-we0-f177.google.com) (74.125.82.177) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 04:24:44 +0000 Received: by mail-we0-f177.google.com with SMTP id x55so2904460wes.8 for ; Mon, 07 Oct 2013 21:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=n/hMxaufIRNnyEUeVXax7a247rfvD0Q1JZHiTrAl+qg=; b=YkExQXv/laFNT7KMAFeMgYI253inWNMt3u1XDeGY6vVAlKZBEAnh0vl/zpu5lJTsg5 qHuH8N6Tna1hcU3T/5fj9h7x3+cV7srboGYF/PjXcIbAyfmLeGEqi3dqrugbxoBHuaSZ 1NhsyuvV8zE67T+vqAofOlEG/1+HanobnN5Tkm12g+yYUakNlwpgYx5EjXTivKYB0PG9 tIcoYB3x/8qyOpQs69yfZxGpPSedDr2LAR2qqW1RS1/qdbo08NlT2Lyx3H7ID/IBl06i I++j66Cr9//yuozBC1Nr84/xD/EAhwCXyicibbJrhEkmoXF/owPSiSaPiwDM/hHNBKLf fWAQ== MIME-Version: 1.0 X-Received: by 10.180.185.101 with SMTP id fb5mr21752064wic.11.1381206264736; Mon, 07 Oct 2013 21:24:24 -0700 (PDT) Received: by 10.194.206.71 with HTTP; Mon, 7 Oct 2013 21:24:24 -0700 (PDT) In-Reply-To: References: <1364580105932-5730094.post@n5.nabble.com> Date: Mon, 7 Oct 2013 23:24:24 -0500 Message-ID: Subject: Re: Camel routing issue From: "kraythe ." To: Camel Users List Content-Type: multipart/alternative; boundary=001a11c2448ec5774104e83324bb X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2448ec5774104e83324bb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Filter has to be first in the route. You can probably only put exception handling and route id before it. The DSL should probably be tighened up for that. *Robert Simmons Jr. MSc. - Lead Java Architect @ EA* *Author of: Hardcore Java (2003) and Maintainable Java (2012)* *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39* On Mon, Oct 7, 2013 at 12:51 PM, prabumca06@gmail.com wrote: > Hi all, > > Good morning, > > I am trying to use when and filter both in my routing,but it didn't work > > I hope it will give you idea what i am trying to achieve > > from(ACT_TYPE_SPECFIC_QNAME).choice() > .when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION)) > .filter(simple("{body[isCredit]} =3D=3D true")) > .process(new Processor() { > public void process(Exchange exchange) { > Map map =3D (Map) exchange.getIn().getBody(); > String Account_No =3D (String) map.get(ACCOUNT_ID); > Map newBody =3D new HashMap(); > newBody.put(ACCOUNT_ID, Account_No); > exchange.getIn().setBody(newBody); > > }}).to(ACTIVATE_QNAME) > .endChoice() > .otherwise() > .setHeader(DESTINATION, constant(DESTINATION_VALUE)) > .to(EROOR_QNAME) > .end(); > > Message reached ACT_TYPE_SPECFIC_QNAME but it only checking when ( > .when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION)) ) condition routing > message to ACTIVATE_QNAME > > Filter not working property in this case. > > Please kindly help me > > > > > On Wed, Sep 4, 2013 at 11:48 PM, Prabu wrote: > > > Hi All, > > > > Camel i having code like this > > > > from(MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME).process(new > > MemosProcess(*getContext().**createProducerTemplate()*)) > > .end(); > > > > Above code worked fine in activemq 5.5 but after upgrade into active 5.= 8 > > it is not working. > > > > Message getting hang in MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME not > > calling memosprocess class. > > > > Please kindly help me. > > > > *Thanks* > > Prabu.N > > > > > > > > On Wed, Jul 24, 2013 at 11:49 PM, Christian Mueller [via Camel] < > > ml-node+s465427n5736234h56@n5.nabble.com> wrote: > > > >> The test ensure it works: > >> > >> @Test > >> public void testInOnlyJMSExpiration() throws Exception { > >> MockEndpoint mock =3D getMockEndpoint("mock:result"); > >> mock.expectedMessageCount(1); > >> > >> long ttl =3D System.currentTimeMillis() + 5000; > >> > >> template.sendBodyAndHeader("activemq:queue:bar?preserveMessageQos=3Dtr= ue", > >> "Hello World", "JMSExpiration", ttl); > >> > >> // sleep just a little > >> Thread.sleep(2000); > >> > >> // use timeout in case running on slow box > >> Exchange bar =3D consumer.receive("activemq:queue:bar", 10000); > >> assertNotNull("Should be a message on queue", bar); > >> > >> template.send("activemq:queue:foo", bar); > >> > >> assertMockEndpointsSatisfied(); > >> } > >> > >> @Test > >> public void testInOnlyJMSExpirationNoMessage() throws Exception { > >> MockEndpoint mock =3D getMockEndpoint("mock:result"); > >> mock.expectedMessageCount(1); > >> > >> long ttl =3D System.currentTimeMillis() + 2000; > >> > >> template.sendBodyAndHeader("activemq:queue:bar?preserveMessageQos=3Dtr= ue", > >> "Hello World", "JMSExpiration", ttl); > >> > >> // sleep more so the message is expired > >> Thread.sleep(5000); > >> > >> Exchange bar =3D consumer.receiveNoWait("activemq:queue:bar"); > >> assertNull("Should NOT be a message on queue", bar); > >> > >> template.sendBody("activemq:queue:foo", "Hello World"); > >> > >> assertMockEndpointsSatisfied(); > >> } > >> > >> protected RouteBuilder createRouteBuilder() throws Exception { > >> return new RouteBuilder() { > >> public void configure() throws Exception { > >> from("activemq:queue:foo") > >> .to("mock:result"); > >> } > >> }; > >> } > >> > >> Check what you do differently... > >> > >> Best, > >> Christian > >> ----------------- > >> > >> Software Integration Specialist > >> > >> Apache Camel committer: https://camel.apache.org/team > >> V.P. Apache Camel: https://www.apache.org/foundation/ > >> Apache Member: https://www.apache.org/foundation/members.html > >> > >> https://www.linkedin.com/pub/christian-mueller/11/551/642 > >> > >> > >> On Wed, Jul 24, 2013 at 4:42 PM, [hidden email]< > http://user/SendEmail.jtp?type=3Dnode&node=3D5736234&i=3D0> > >> <[hidden email] >>wrote: > >> > >> > >> > Hi Chris, > >> > > >> > Thanks so much for the information. > >> > > >> > I have tried different property but it did not work. > >> > > >> > Please find my code below. > >> > > >> > *public static final String CONSUMER_TEST_QNAME =3D > >> > > >> > > >> > "activemq:queue:ConsumerTestHandler?jmsMessageType=3DText&preserveMessage= Qos=3Dtrue"; > >> > >> > * > >> > * > >> > * > >> > *public static final String PRODUCER_TEST_QNAME =3D > >> > > >> > > >> > "activemq:queue:ProducerTestHandler?jmsMessageType=3DText&preserveMessage= Qos=3Dtrue"; > >> > >> > * > >> > * * > >> > *public static final String > MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME > >> =3D > >> > "activemq:queue:Inbound.Memos.Consumer.Test";* > >> > * > >> > * > >> > *public static final String > MESSAGING_TEST_PRODUCER_TYPE_SPECIFIC_QNAME > >> =3D > >> > "activemq:queue:Inbound.Memos.Producer.Test";* > >> > > >> > > >> > from(*MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME*).process(new > >> Processor() > >> > { > >> > public void process(Exchange exchange) throws Exception { > >> > > >> > } > >> > .setHeader(MEMOS_TARGET_SERVER,header(MASTER_HANDLER)) > >> > .setHeader(JMSExpiration,constant(EXPIRY_TIME)) > >> > .to(CONSUMER_TEST_QNAME) > >> > .setHeader(MEMOS_TARGET_SERVER, header(SLAVE_HANDLER)) > >> > .setHeader(JMSExpiration,constant(EXPIRY_TIME)) > >> > .to(CONSUMER_TEST_QNAME) > >> > .end(); > >> > > >> > But,messages not expiring > >> > > >> > Please kindly help me > >> > > >> > *Thanks* > >> > Prabu.N > >> > > >> > > >> > On Wed, Jul 24, 2013 at 1:46 AM, Christian Mueller [via Camel] < > >> > [hidden email] >> > >> wrote: > >> > > >> > > It's not really so difficult to find an example, if you spend only= a > >> few > >> > > minutes: > >> > > > >> > > > >> > > >> > https://git-wip-us.apache.org/repos/asf?p=3Dcamel.git;a=3Dblob;f=3Dcompon= ents/camel-jms/src/test/java/org/apache/camel/component/jms/JmsProducerWith= JMSHeaderTest.java;h=3D52b430b17a7ffc0ca977864ea8c6238050f90a57;hb=3DHEAD > >> > > > >> > > Best, > >> > > Christian > >> > > ----------------- > >> > > > >> > > Software Integration Specialist > >> > > > >> > > Apache Camel committer: https://camel.apache.org/team > >> > > V.P. Apache Camel: https://www.apache.org/foundation/ > >> > > Apache Member: https://www.apache.org/foundation/members.html > >> > > > >> > > https://www.linkedin.com/pub/christian-mueller/11/551/642 > >> > > > >> > > > >> > > ------------------------------ > >> > > If you reply to this email, your message will be added to the > >> discussion > >> > > below: > >> > > > >> > > > >> > > >> > http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5736163.h= tml > >> > > To unsubscribe from Camel routing issue, click here< > >> > > >> > > >> > > . > >> > > NAML< > >> > > >> > http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=3Dmacro_= viewer&id=3Dinstant_html%21nabble%3Aemail.naml&base=3Dnabble.naml.namespace= s.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.t= emplate.NodeNamespace&breadcrumbs=3Dnotify_subscribers%21nabble%3Aemail.nam= l-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.= naml > >> > > > >> > > > >> > > >> > > >> > > >> > -- > >> > Thanks & Regards > >> > Prabu.N > >> > > >> > > >> > > >> > > >> > -- > >> > View this message in context: > >> > > >> > http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5736224.h= tml > >> > >> > Sent from the Camel - Users mailing list archive at Nabble.com. > >> > > >> > >> > >> ------------------------------ > >> If you reply to this email, your message will be added to the > >> discussion below: > >> > >> > http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5736234.h= tml > >> To unsubscribe from Camel routing issue, click here< > http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=3Dunsubs= cribe_by_code&node=3D5730094&code=3DcHJhYnVtY2EwNkBnbWFpbC5jb218NTczMDA5NHw= 4OTY0MTU3ODg=3D > > > >> . > >> NAML< > http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=3Dmacro_= viewer&id=3Dinstant_html%21nabble%3Aemail.naml&base=3Dnabble.naml.namespace= s.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.t= emplate.NodeNamespace&breadcrumbs=3Dnotify_subscribers%21nabble%3Aemail.nam= l-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.= naml > > > >> > > > > > > > > -- > > Thanks & Regards > > Prabu.N > > > > > > -- > Thanks & Regards > Prabu.N > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Camel-routing-issue-tp5730094p5741054.h= tml > Sent from the Camel - Users mailing list archive at Nabble.com. --001a11c2448ec5774104e83324bb--