Discussion:
Does a AsyncProcessor in a Consumer guarantee delivery order?
kwispel
2018-12-09 16:26:29 UTC
Permalink
Hi everyone,

I am writing a consumer as part of my custom Camel component. I want to give subsequent components the opportunity to process my messages in parallel, to improve throughput. This means I should send `message 2` as soon as possible - that is, without waiting on the feedback loop of `message 1`.

I do the following in my consumer:

while (isRunAllowed()) {
Exchange exchange = ...; // retrieve and prepare next message, ordered

getAsyncProcessor().process(exchange, new AsyncCallback() {

public void done(boolean doneSync){

...

}

}

}

As you can see, all getAsyncProcessor().process() calls are done in a certain order. Will this order be preserved when the messages arrive on the producer of the next component in the route?

Thank you very much!

Loading...