You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jmh <je...@nrb.be> on 2012/01/15 11:11:16 UTC

fork & join pattern with Camel

Hello,

could you tell me what is the best way in Camel to implement the fork & join
pattern (wait, and/or condition) ?

I don't want to use BPEL since my workflow is implemented using pure Java
code rather than declarative XML.

Thanks for your help

Regards

--
View this message in context: http://camel.465427.n5.nabble.com/fork-join-pattern-with-Camel-tp5146192p5146192.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: fork & join pattern with Camel

Posted by Raul Kripalani <ra...@fusesource.com>.
Hi,

You can use split/aggregate if you need a scatter/gather pattern, i.e. if
your original message is composed of several individual units and you want
to splice it up and process each one independently, waiting at the end to
collect all responses and then continue processing.

If you require a more traditional and flexible BPEL-like approach which
allows you to fork your processing into different branches (BPEL <flow />)
without splitting up the original message, you can use Multicast with
parallelProcessing=true. See [1].

Beware that the latter by default will only keep the last reply as the
overall outgoing response, so if you want to aggregate all responses you
need to define your own strategyRef.

Hope that helps.

[1] http://camel.apache.org/multicast.html.

Regards,
Raúl.

On 15 January 2012 10:34, Christian Müller <ch...@gmail.com>wrote:

> fork == split [1]
> join == aggregate [2]
>
> [1] http://camel.apache.org/splitter.html
> [2] http://camel.apache.org/aggregator2.html
>
> Best,
> Christian
>
> On Sun, Jan 15, 2012 at 11:11 AM, jmh <je...@nrb.be> wrote:
>
> > Hello,
> >
> > could you tell me what is the best way in Camel to implement the fork &
> > join
> > pattern (wait, and/or condition) ?
> >
> > I don't want to use BPEL since my workflow is implemented using pure Java
> > code rather than declarative XML.
> >
> > Thanks for your help
> >
> > Regards
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/fork-join-pattern-with-Camel-tp5146192p5146192.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>

Re: fork & join pattern with Camel

Posted by Christian Müller <ch...@gmail.com>.
fork == split [1]
join == aggregate [2]

[1] http://camel.apache.org/splitter.html
[2] http://camel.apache.org/aggregator2.html

Best,
Christian

On Sun, Jan 15, 2012 at 11:11 AM, jmh <je...@nrb.be> wrote:

> Hello,
>
> could you tell me what is the best way in Camel to implement the fork &
> join
> pattern (wait, and/or condition) ?
>
> I don't want to use BPEL since my workflow is implemented using pure Java
> code rather than declarative XML.
>
> Thanks for your help
>
> Regards
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/fork-join-pattern-with-Camel-tp5146192p5146192.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>