You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Victor NOËL <vi...@linagora.com> on 2015/05/22 14:08:18 UTC

Meaning of synchronous for a from()

Hi,

I have trouble of understanding the meaning of "synchronous" parameter 
on a from() in a route.

Does it mean the whole route will be execute with the syncronous API?

I ask because from the few tests I did, it seems that even though the 
first call goes through calls to process() without AsyncCallback, then 
the following ones in a route seems to be going through process() with 
AsyncCallback!

I'm developing a component and I'm not sure what to write in the 
documentation about the effect of synchronous on the consumer :)
For now I just call the processor with the non-async API:
https://github.com/petalslink/petals-se-camel/blob/master/camel-petals/src/main/java/org/ow2/petals/camel/component/PetalsCamelConsumer.java#L67

Thanks!

Victor

Re: Meaning of synchronous for a from()

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, May 22, 2015 at 2:08 PM, Victor NOËL <vi...@linagora.com> wrote:
> Hi,
>
> I have trouble of understanding the meaning of "synchronous" parameter on a
> from() in a route.
>
> Does it mean the whole route will be execute with the syncronous API?
>

No it means the thread in the consumer will wait.

But mid route then there can be async as well mixed in, it really
depends if you configure those to not allow async, by setting
synchronous=true as well on the endpoints.


> I ask because from the few tests I did, it seems that even though the first
> call goes through calls to process() without AsyncCallback, then the
> following ones in a route seems to be going through process() with
> AsyncCallback!
>
> I'm developing a component and I'm not sure what to write in the
> documentation about the effect of synchronous on the consumer :)
> For now I just call the processor with the non-async API:
> https://github.com/petalslink/petals-se-camel/blob/master/camel-petals/src/main/java/org/ow2/petals/camel/component/PetalsCamelConsumer.java#L67
>
> Thanks!
>
> Victor



-- 
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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/