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: Using Asynchronous Processors -- a little help
Date Sat, 02 Oct 2010 14:48:59 GMT
See these pages
http://camel.apache.org/asynchronous-routing-engine.html
http://camel.apache.org/asynchronous-processing.html

The SEDA component will most likely be improved in Camel 3.0 to
leverage the async routing engine to the fullest.
We opted to not change it during 2.x as it would break current behavior of SEDA.

Also chapter 10 in the Camel book covers this as well.


On Fri, Oct 1, 2010 at 10:21 PM, Seth Call <sethcall@gmail.com> wrote:
> I'm a little lost on Asynchronous Processors.
>
> My goal is to not use threads needlessly, so that's why I'm zeroed in
> on Asynchronous Processors.
>
> First off, is it fair to assume that JMS can be fully asynchronous
> when using a request-reply schema?  Assuming so, here' is my problem:
>
> I don't really understand how to set up a route such that my client
> code, and my server code, both use no threads. Most examples I see are
> inherently synchronous.  For instance, I can't use a bean callback on
> the consumer side, I think, because that's naturally going to tie up a
> thread, right?
>
> So let me put down some routes I've been playing with (and yes, my
> inline processor is synchronously coded at the moment, but obviously
> it could be made asynchronous easily with that as a starting point)
>
> from("seda:test").to("jms:queue:a.test");
>
>        from("jms:queue:a.test")
>
>                .process(new AsyncProcessor() {
>                    @Override public boolean process(final Exchange
> exchange, final AsyncCallback callback) {
>                        String body = exchange.getIn().getBody(String.class);
>                        exchange.getOut().setBody("echo: " + body);
>
>                        bool sync = true;
>                        callback.done(sync);
>                        return sync;
>                    }
>
>                    @Override public void process(final Exchange
> exchange) throws Exception {
>
>                    }
>                });
>
>
> I am thinking it's incorrect to use SEDA as a client endpoint, though,
> because I find it only works if it's blocking synchronously on the
> client side. (or am I wrong?)
>
> I have no specific interest in using SEDA, I just want to use an
> interface on the client side that allows me to fire off an exchange,
> and get a callback later.  I thought SEDA was generally 'asynchronous'
> so I started there.
>
> Any suggestions for sending the message off?
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message