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: Synchronous Routing
Date Mon, 05 Sep 2011 12:29:41 GMT
The consumer thread keeps running, so you need logic in the read()
method to wait until Camel have processed the exchange.
How do you send the message from the read method to Camel?


On Mon, Sep 5, 2011 at 2:10 PM, ravi <ravi.tyagi@esq.com> wrote:
> I am using DefaultConsumer which is reading row from a Database (A:reader
> where A is a custom Component ).
>
>
>
> The code to activate Consumer is:
>
> public Consumer createConsumer(Processor processor) throws Exception {
>        return new DefaultConsumer(this, processor) {
>            @Override
>            public void start() throws Exception {
>                super.start();
>                                activateConsumer(this);
>            }}}
>
> protected void activateConsumer(DefaultConsumer consumer) throws IOException
> {
>        thread = new Thread()
>        {
>                @Override
>                public void run() {
>                        while(keepRunning == true)
>                        {
>                                read();
>                        }
>                }
>        };
>        thread.setName("Thread: " + getEndpointUri());
>        thread.setDaemon(true);
>        thread.start();
> }
>
> And the CAMEL Version is 2.7.0
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Synchronous-Routing-tp4769944p4770271.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/

Mime
View raw message