You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by javaxmlsoapdev <ja...@yahoo.com> on 2012/04/22 15:48:54 UTC

Aggregator from JMS endpoints

Hello,

I am just starting to learn camel and stumbled upon a question for a use
case that I am dealing with. I need to design a route which consumes
messages from one JMS queue (call it a activeMQ.queue.sourceQueue) and
dispatched to multiple destination queues (call them
activeMQ.queue.destination1, activeMQ.queue.destination2 etc). sure will
there be intermediate processing/business logic etc before forwarding to the
destination queues. 

Now when publishing to one of the JMS destination(queue) fails (let's say
there were two and one failed), then I want camel to retry it(redeliver) for
3 times before raising an exception. In this scenario publishing to another
queue was successful but 1st queue failed so aggregator should return false
or throw an exception for first JMS source endpoint to keep the message in
the source queue(or error queue). which will be picked up again at a later
point of time and go through the same logic/route etc.

I am not sure how to design such aggregator which publishes to JMS queues
and gather exceptions/success etc?

Another question is how can we scale this aggregator since potentially we'll
be dealing with millions of messages. 

Any help/pointers/samples are appreciated.

Thanks,

--
View this message in context: http://camel.465427.n5.nabble.com/Aggregator-from-JMS-endpoints-tp5657471p5657471.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Aggregator from JMS endpoints

Posted by javaxmlsoapdev <ja...@yahoo.com>.
Thanks Claus Ibsen-2 

So with transacted=true on JMS endpoints and given my use case, do you think
I don't need any AggregationStrategy?

again use case: Pick up a message from one JMS queue (Camel consumer) and
apply some business logic and then fiinally publish that message to multiple
JMS queues, but if publishing to one of the queues fails then redeliver AND
if publishing to 2 queues was successful, out of total 3 queues, then
message must be delivered to those 2 queues but only failed for the 3rd one. 

Given this use case , do you think there isn't any aggregationstrategy
required?

thanks again,

--
View this message in context: http://camel.465427.n5.nabble.com/Aggregator-from-JMS-endpoints-tp5657471p5659372.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Aggregator from JMS endpoints

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can use JMS transacted acknowledge mode  (eg setting
transacted=true) on the jms component.
Then in if the processing of the message fails then the message will
not be ack and it will be kept on the queue and redelivered by the JMS
broker.

You can then configure Camel's error handler / onException to use
maximumRedeliveries = 3, and maybe put some delays between so it waits
X seconds between redelivery attempts.



On Sun, Apr 22, 2012 at 3:48 PM, javaxmlsoapdev
<ja...@yahoo.com> wrote:
> Hello,
>
> I am just starting to learn camel and stumbled upon a question for a use
> case that I am dealing with. I need to design a route which consumes
> messages from one JMS queue (call it a activeMQ.queue.sourceQueue) and
> dispatched to multiple destination queues (call them
> activeMQ.queue.destination1, activeMQ.queue.destination2 etc). sure will
> there be intermediate processing/business logic etc before forwarding to the
> destination queues.
>
> Now when publishing to one of the JMS destination(queue) fails (let's say
> there were two and one failed), then I want camel to retry it(redeliver) for
> 3 times before raising an exception. In this scenario publishing to another
> queue was successful but 1st queue failed so aggregator should return false
> or throw an exception for first JMS source endpoint to keep the message in
> the source queue(or error queue). which will be picked up again at a later
> point of time and go through the same logic/route etc.
>
> I am not sure how to design such aggregator which publishes to JMS queues
> and gather exceptions/success etc?
>
> Another question is how can we scale this aggregator since potentially we'll
> be dealing with millions of messages.
>
> Any help/pointers/samples are appreciated.
>
> Thanks,
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Aggregator-from-JMS-endpoints-tp5657471p5657471.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/