You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mgiammarco <mg...@gmail.com> on 2012/03/28 21:31:12 UTC
RecipientList without aggregation
Hello,
I am getting confused because there are so many ways to do this thing.
I need that, in my route message X get copied n times to n different beans.
I need to choose which beans as recipientlist patterns says. Now I need that
each bean is parallel processed.
But I do NOT need absolutely messages aggregation. I do NOT need also that
faster beans wait for slower beans before sending the result.
I need simply that the n messages will go in an output route as fast as
possible.
I am looking recipientlist, multicast, parallel processing and I am getting
confused. I think recipientlist with an header with the list of beans can
work but I am not sure.
Can you help me?
Thanks,
Mario
--
View this message in context: http://camel.465427.n5.nabble.com/RecipientList-without-aggregation-tp5601505p5601505.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: RecipientList without aggregation
Posted by mgiammarco <mg...@gmail.com>.
RubyTuesdayDONO wrote
>
> Mario,
>
> if you know in advance which beans will be consuming from the endpoint,
> you
> could define them statically using Multicast, without the dynamism of
> Recipient-List.
>
Thank you for your suggestions but the new requirements from my customer
implies a dynamic recipient list. Anyway I will look if I can go back to a
static list.
--
View this message in context: http://camel.465427.n5.nabble.com/RecipientList-without-aggregation-tp5601505p5608600.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: RecipientList without aggregation
Posted by Claus Ibsen <cl...@gmail.com>.
On Sat, Mar 31, 2012 at 12:55 PM, mgiammarco <mg...@gmail.com> wrote:
>
> Claus Ibsen-2 wrote
>>
>> Hi
>>
>> Sometimes you can also just use a bean method, and from there use the
>> ProducerTemplate to send your messages wherever you want, and you can
>> send multiple messages to X different endpoints etc. And you don't
>> have to wait for replies as you can send the messages as one-way etc.
>>
>>
> I have not yet bought the book unfortunately. But looking at your reply it
> seems different to my situation.
>
> I am in the middle of a route, I am not an "outside" thread that inject
> messages in an already built route.
>
> Do you mean that inside a routed bean ( to("bean:foo") ) I can use producer
> template?
>
Yes you can use a producer template from anywhere you want.
> Now my solution is this: the bean put a list of destinations in an header
> that is then used by recipientlist()
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/RecipientList-without-aggregation-tp5601505p5608610.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/
Re: RecipientList without aggregation
Posted by mgiammarco <mg...@gmail.com>.
Claus Ibsen-2 wrote
>
> Hi
>
> Sometimes you can also just use a bean method, and from there use the
> ProducerTemplate to send your messages wherever you want, and you can
> send multiple messages to X different endpoints etc. And you don't
> have to wait for replies as you can send the messages as one-way etc.
>
>
I have not yet bought the book unfortunately. But looking at your reply it
seems different to my situation.
I am in the middle of a route, I am not an "outside" thread that inject
messages in an already built route.
Do you mean that inside a routed bean ( to("bean:foo") ) I can use producer
template?
Now my solution is this: the bean put a list of destinations in an header
that is then used by recipientlist()
--
View this message in context: http://camel.465427.n5.nabble.com/RecipientList-without-aggregation-tp5601505p5608610.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: RecipientList without aggregation
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Sometimes you can also just use a bean method, and from there use the
ProducerTemplate to send your messages wherever you want, and you can
send multiple messages to X different endpoints etc. And you don't
have to wait for replies as you can send the messages as one-way etc.
If you got the Camel in Action book, then see section 10.5.2, which
has an example of sending a copy of a message to X endpoints, and then
waiting at most X time before computing a reply. In your example you
dont have to wait at all.
On Wed, Mar 28, 2012 at 11:33 PM, Reuben Garrett
<re...@gmail.com> wrote:
> Mario,
>
> if you know in advance which beans will be consuming from the endpoint, you
> could define them statically using Multicast, without the dynamism of
> Recipient-List. if you don't need to await responses from the Multicast
> targets before continuing from the Multicast block to the next pipe in the
> route, i think setting parallelProcessing=true and streaming=true, combined
> with using the inOnly Message Exchange Pattern [1] for each target in the
> Multicast, *might* work (committers - is this correct?).
>
> however, i employed a different approach for a similar scenario where i
> just need to dispatch a "fire-and-forget" event to a set of consumers. i
> used SEDA [2] queues with multipleConsumers=true for a lightweight
> multicast. if you want to, you could even combine outputs later on in a
> "gathering" SEDA queue that funnels into an aggregator or other processor /
> Enterprise Integration Pattern [3].
>
> SEDA is probably my favorite component as there are some fun split/join
> flows you can orchestrate with it.
>
> [1]: http://camel.apache.org/exchange-pattern.html
> [2]: http://camel.apache.org/seda.html
> [3]: http://camel.apache.org/enterprise-integration-patterns.html
>
> ~ Reuben
>
> On Wed, Mar 28, 2012 at 14:31, mgiammarco <mg...@gmail.com> wrote:
>
>> Hello,
>> I am getting confused because there are so many ways to do this thing.
>>
>> I need that, in my route message X get copied n times to n different beans.
>> I need to choose which beans as recipientlist patterns says. Now I need
>> that
>> each bean is parallel processed.
>>
>> But I do NOT need absolutely messages aggregation. I do NOT need also that
>> faster beans wait for slower beans before sending the result.
>>
>> I need simply that the n messages will go in an output route as fast as
>> possible.
>>
>> I am looking recipientlist, multicast, parallel processing and I am getting
>> confused. I think recipientlist with an header with the list of beans can
>> work but I am not sure.
>>
>> Can you help me?
>>
>> Thanks,
>> Mario
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/RecipientList-without-aggregation-tp5601505p5601505.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/
Re: RecipientList without aggregation
Posted by Reuben Garrett <re...@gmail.com>.
Mario,
if you know in advance which beans will be consuming from the endpoint, you
could define them statically using Multicast, without the dynamism of
Recipient-List. if you don't need to await responses from the Multicast
targets before continuing from the Multicast block to the next pipe in the
route, i think setting parallelProcessing=true and streaming=true, combined
with using the inOnly Message Exchange Pattern [1] for each target in the
Multicast, *might* work (committers - is this correct?).
however, i employed a different approach for a similar scenario where i
just need to dispatch a "fire-and-forget" event to a set of consumers. i
used SEDA [2] queues with multipleConsumers=true for a lightweight
multicast. if you want to, you could even combine outputs later on in a
"gathering" SEDA queue that funnels into an aggregator or other processor /
Enterprise Integration Pattern [3].
SEDA is probably my favorite component as there are some fun split/join
flows you can orchestrate with it.
[1]: http://camel.apache.org/exchange-pattern.html
[2]: http://camel.apache.org/seda.html
[3]: http://camel.apache.org/enterprise-integration-patterns.html
~ Reuben
On Wed, Mar 28, 2012 at 14:31, mgiammarco <mg...@gmail.com> wrote:
> Hello,
> I am getting confused because there are so many ways to do this thing.
>
> I need that, in my route message X get copied n times to n different beans.
> I need to choose which beans as recipientlist patterns says. Now I need
> that
> each bean is parallel processed.
>
> But I do NOT need absolutely messages aggregation. I do NOT need also that
> faster beans wait for slower beans before sending the result.
>
> I need simply that the n messages will go in an output route as fast as
> possible.
>
> I am looking recipientlist, multicast, parallel processing and I am getting
> confused. I think recipientlist with an header with the list of beans can
> work but I am not sure.
>
> Can you help me?
>
> Thanks,
> Mario
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/RecipientList-without-aggregation-tp5601505p5601505.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>