1 Reply Latest reply on Jun 8, 2010 11:22 AM by davsclaus

    Camel Component with a Asynchronous Producer

    pchandler

      I am trying to implement my own/custom Camel Component with a Asynchronous Producer. And I have some general questions.

       

      Was the Camel Asyn API changed between camel versions?

       

      Examples:

      public boolean process(Exchange exchange, AsyncCallback callback)

      .vs

      public void process(Exchange exchange, AsyncCallback callback)

       

      callback.done(false)

      .vs

      callback.onTaskCompleted(Exchange)

       

      I am using camel-core 2.2.0-fuse-01-00. Where is the documentation for Camel 2.2.0? "After the reply arrives, the Runnable object inserts the reply (Out message) into the exchange object and then calls done() on the asynchronous callback object. The asynchronous callback is then responsible for processing the reply message (executed in the sub-thread)." - http://fusesource.com/docs/router/2.2/prog_guide/index.html I do not see a done() method on class AsyncCallback (only onTaskCompleted() ) for camel version 2.2?

       

      org.apache.camel.impl.DefaultProducer.process(Exchange exchange, AsyncCallback callback)

      As a camel component developer do I have to implement a AsyncCallback? If so how? Or is the object past in?

       

      For org.apache.camel.impl.DefaultProducer.process() do I have to implement both syn and asyn methods?

      How does camel know the call the Asyn version of process()?

       

      Is there some sample/example java code for a Camel Component  (version 2.2) with a Asynchronous Producer that I can look at? 

       

      Thanks in advance,

       

      Peter.