camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William Tam" <email.w...@gmail.com>
Subject Re: a few comments on SedaComponent
Date Fri, 05 Oct 2007 19:10:03 GMT
On 10/4/07, Hiram Chirino <hiram@hiramchirino.com> wrote:
> On 10/4/07, William Tam <email.wtam@gmail.com> wrote:
> > 1. In SedaEndpoint.process(Exchange exchange, AsyncCallback callback)
> > method.   I wouldn't expect callback.done() to be invoked immediately
> > when an exchange is enqueued.  (right?) But rather I would expect
> > callbacks are enqueued with the exchanges so that when the
> > SedaConsumer can invoke them after their corresponding exchanges are
> > processed.
>
> I don't agree.  I think seda should behave like a jms queue.. The
> producer is done when the message gets enqueued.  If what you are
> trying to do is to do async processing of a pipeline, you should use
> the thread processor, like:
> from(x).thread(5).to(y)
>

How about if I want to have a seda rather than just a thread pool?  I
want to have a bunch of stages.  Each stage is a queue backed by a
thread pool and some processing.

So, I might have something like:

from("seda:stage1").thread(pool).process(...).to("seda:stage2"), and so forth

If I make a async-send to seda:stage1, my callback is called when my
exchange has been enqueued to stage1.  IMO, this notification is not
very useful.  Actually, I think there is no point in making an async
call at all. since I know my exchange has been enqueued when the send
call returns (in either sync or async).

But if my callback is invoked after my exchange has been processed by
the seda consumer of seda:stage1, I am notified when stage one is
finished which gives me a reason to do async send.   If I want to be
notified this way, can it be done with pipeline or something else?

BTW, I think if the callback passes me the processed exchange, there
would be super nice.  I probably care more about out message (if any)
than whether it has been done synchronously or not.

Mime
View raw message