You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Babel <ch...@gmail.com> on 2012/02/28 15:23:41 UTC

InOut with asyncProcessor seems not to wait for completion

Hello everyone

I'm trying to get asynchronous processing in my component and got some
difficulties, I followed the tutorial on
http://camel.apache.org/asynchronous-processing.html.

 In my test
from(myprotocl:endpoint).to(myprotocol:endpoint?exchangePattern=InOut)

the asynchronous process method is loaded but the consumer receives the
exchange without the producer modifications unless I wait a little bit after
the processor.process call (in the consumer).

Do I need to wait on some exchange modification? (As I do not get the
AsynchCallback in the consumer)?

Any help would be really welcome!

Thanks

Christophe

--
View this message in context: http://camel.465427.n5.nabble.com/InOut-with-asyncProcessor-seems-not-to-wait-for-completion-tp5521960p5521960.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: InOut with asyncProcessor seems not to wait for completion

Posted by Babel <ch...@gmail.com>.
a Huge thanks for that point which solved my problem!
Best regards

Christophe

--
View this message in context: http://camel.465427.n5.nabble.com/InOut-with-asyncProcessor-seems-not-to-wait-for-completion-tp5521960p5525058.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: InOut with asyncProcessor seems not to wait for completion

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

You need to use the async routing in the consumer to kick off this.

Something along the lines of to have your consumer support the async
routing engine.
And in the done method you can do any done work in your consumer if
you need that.

            AsyncProcessorHelper.process(processor, exchange, new
AsyncCallback() {
                public void done(boolean doneSync) {
                    // noop
                }
            });


Alternatively if you extend DefaultConsumer, you can do

getAsyncProcessor().process(exchange, new AsyncCallback() {
                public void done(boolean doneSync) {
                    // noop
                }
            });


On Tue, Feb 28, 2012 at 3:23 PM, Babel <ch...@gmail.com> wrote:
> Hello everyone
>
> I'm trying to get asynchronous processing in my component and got some
> difficulties, I followed the tutorial on
> http://camel.apache.org/asynchronous-processing.html.
>
>  In my test
> from(myprotocl:endpoint).to(myprotocol:endpoint?exchangePattern=InOut)
>
> the asynchronous process method is loaded but the consumer receives the
> exchange without the producer modifications unless I wait a little bit after
> the processor.process call (in the consumer).
>
> Do I need to wait on some exchange modification? (As I do not get the
> AsynchCallback in the consumer)?
>
> Any help would be really welcome!
>
> Thanks
>
> Christophe
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/InOut-with-asyncProcessor-seems-not-to-wait-for-completion-tp5521960p5521960.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
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/