camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Best practice question
Date Thu, 17 Oct 2013 06:30:27 GMT
Hi

Yeah you can also take a look at on completion
http://camel.apache.org/oncompletion.html

On Thu, Oct 17, 2013 at 2:37 AM, Henrique Viecili <viecili@gmail.com> wrote:
> Hi Joe,
>
> take a look at
> http://camel.apache.org/splitter.html#Splitter-Splitaggregaterequest%2Freplysample
> ,
> after you end() your split do a wireTap to the second long running task.
> (assuming the exchange pattern is InOut)
>
> Cheers,
> Henrique
>
> Henrique Viecili
>
>
> 2013/10/17 Joe Osowski <joe.osowski@gmail.com>
>
>> Dear Camel users.
>>
>> Given the following DSL.  What would be the best way to execute a task
>> when all the below processing is complete?
>>
>> Specifically, I have a second long running task that needs to get
>> queued as soon as  FOO2_QUEUE is complete.
>>
>>     from(FOO_QUEUE)
>>       .to("bean:service?method=getFoo(${body})")
>>       .process(new Processor() {
>>         @Override
>>         public void process(Exchange exchange) throws Exception {
>>           //All we care about is the citedArticle IDs list
>>           List<Long> ids = exchange.getIn().getBody(Foo.class).getIDs();
>>           exchange.getOut().setBody(ids);
>>         }
>>       })
>>       .split().body() //Create a job for each ID
>>       .to(FOO2_QUEUE)
>>
>>     from(FOO2_QUEUE)
>>       .to("bean:service?method=foo");
>>



-- 
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

Mime
View raw message