You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by kwispel <kw...@protonmail.com.INVALID> on 2018/12/09 16:26:29 UTC

Does a AsyncProcessor in a Consumer guarantee delivery order?

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!