You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Dayakar <da...@gmail.com> on 2013/12/12 11:11:34 UTC
ConsumerTemplate is not fetching data in insertion Order
Hi,
I have some messages in the JMS Queue and if i fetch the message from Queue
by using
consumerTemplate.receiveBodyNoWait("jms:queue:destinationEndPoint",
String.class);
By i observed that consumerTemplate is not maintaining insertion order.
Please let me know how can i get insertion order by using consumerTemplate
--
View this message in context: http://camel.465427.n5.nabble.com/ConsumerTemplate-is-not-fetching-data-in-insertion-Order-tp5744663.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: ConsumerTemplate is not fetching data in insertion Order
Posted by "kraythe ." <kr...@gmail.com>.
Since JMS is asynchrous this is expected. Why do you need them in a
specific order? If you really do then I would put an aggregator on the
consuming route and write an aggregation strategy that would enforce order.
*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
<http://www.linkedin.com/pub/robert-simmons/40/852/a39>*
On Sun, Dec 15, 2013 at 11:17 PM, Dayakar <da...@gmail.com> wrote:
> Hi Claus,Thanks for your reply.I want to add some more information.We are
> having a route which is configured with parallel
> Processing.from("jms:queue:jobQueue" + "?" + Constants.CONCURRENT_CONSUMERS
> + "=" +
> (Constants.CONCURRENT_CONSUMERS) + "&"
> +
> Constants.MAX_CONCURRENT_CONSUMERS + "="
> +
> (Constants.MAX_CONCURRENT_CONSUMERS) + "&"
> +
> Constants.MAX_MESSAGES_PERTASK + "="
> +
> (Constants.MAX_MESSAGES_PERTASK)) .transacted() .process(new
> JobProcessor())
> .split((body())) .to("jms:queue:destinationQueue");Where Job
> Processor
> prepares a list, each list contains two Messages ex: List1(m1, m2)
> List(m3,m4) List(m5, m6)By using Split() method, we keep each message
> in
> Outbound Queue (m1, m2, m3, m4, m5, m6).While fetching messages from
> outbound queue using ConsumerTemplate
> consumerTemplate.receiveBodyNoWait("jms:queue:destinationQueue",
> String.class);/*we are not getting insertion order (m2, m1, m4, m5, m3,
> m6).*/We are using camel 2.9.2.jar and VM Broker.Please help us to resolve
> this issue.Regards,Dayakar
> Dayakar wrote
> > Hi Claus,We are using Camel 2.9.2 version.
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/ConsumerTemplate-is-not-fetching-data-in-insertion-Order-tp5744663p5744813.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: ConsumerTemplate is not fetching data in insertion Order
Posted by Dayakar <da...@gmail.com>.
Hi Claus,Thanks for your reply.I want to add some more information.We are
having a route which is configured with parallel
Processing.from("jms:queue:jobQueue" + "?" + Constants.CONCURRENT_CONSUMERS
+ "=" + (Constants.CONCURRENT_CONSUMERS) + "&" +
Constants.MAX_CONCURRENT_CONSUMERS + "=" +
(Constants.MAX_CONCURRENT_CONSUMERS) + "&" +
Constants.MAX_MESSAGES_PERTASK + "=" +
(Constants.MAX_MESSAGES_PERTASK)) .transacted() .process(new JobProcessor())
.split((body())) .to("jms:queue:destinationQueue");Where Job Processor
prepares a list, each list contains two Messages ex: List1(m1, m2)
List(m3,m4) List(m5, m6)By using Split() method, we keep each message in
Outbound Queue (m1, m2, m3, m4, m5, m6).While fetching messages from
outbound queue using ConsumerTemplate
consumerTemplate.receiveBodyNoWait("jms:queue:destinationQueue",
String.class);/*we are not getting insertion order (m2, m1, m4, m5, m3,
m6).*/We are using camel 2.9.2.jar and VM Broker.Please help us to resolve
this issue.Regards,Dayakar
Dayakar wrote
> Hi Claus,We are using Camel 2.9.2 version.
--
View this message in context: http://camel.465427.n5.nabble.com/ConsumerTemplate-is-not-fetching-data-in-insertion-Order-tp5744663p5744813.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: ConsumerTemplate is not fetching data in insertion Order
Posted by Dayakar <da...@gmail.com>.
Hi Claus,
We are using Camel 2.9.2 version.
--
View this message in context: http://camel.465427.n5.nabble.com/ConsumerTemplate-is-not-fetching-data-in-insertion-Order-tp5744663p5744805.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: ConsumerTemplate is not fetching data in insertion Order
Posted by Claus Ibsen <cl...@gmail.com>.
What Camel version and what JMS broker are you using?
On Thu, Dec 12, 2013 at 11:11 AM, Dayakar <da...@gmail.com> wrote:
> Hi,
>
> I have some messages in the JMS Queue and if i fetch the message from Queue
> by using
> consumerTemplate.receiveBodyNoWait("jms:queue:destinationEndPoint",
> String.class);
>
> By i observed that consumerTemplate is not maintaining insertion order.
>
> Please let me know how can i get insertion order by using consumerTemplate
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/ConsumerTemplate-is-not-fetching-data-in-insertion-Order-tp5744663.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io
Re: ConsumerTemplate is not fetching data in insertion Order
Posted by Richard Kettelerij <ri...@gmail.com>.
A JMS queue is asynchronous by design, so it makes perfect sense insertion
order isn't maintained since ordering isn't guaranteed.
On Thu, Dec 12, 2013 at 11:11 AM, Dayakar <da...@gmail.com> wrote:
> Hi,
>
> I have some messages in the JMS Queue and if i fetch the message from Queue
> by using
> consumerTemplate.receiveBodyNoWait("jms:queue:destinationEndPoint",
> String.class);
>
> By i observed that consumerTemplate is not maintaining insertion order.
>
> Please let me know how can i get insertion order by using consumerTemplate
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/ConsumerTemplate-is-not-fetching-data-in-insertion-Order-tp5744663.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>