> >
> > 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.
> >
>
> Since the caller of the asyc process call passes in the exchange, he
> can pass that same exchange to the call back via either injection or
> via final local reference. Something like:
>
> final Exchange exch = ...
> processor.process(exch, new AsyncCallback() {
> public void done(boolean sync) {
> System.out.println( exch.getOut() );
> }
> });
>
Actually, this technique does not work for any component producer that
makes a copy of the exchange. For example, the seda producer makes a
copy of an exchange and endqueue the copy.
public boolean process(Exchange exchange, AsyncCallback callback) {
queue.add(exchange.copy());
callback.done(true);
return true;
}
Then, the seda consumer thread could update (in, out, fault) messages
in the copied exchange but any update can not be seen in the orginal
exchange (as in your example).