Bachi
Bachi

Reputation: 6517

Camel: How to process IMAP emails in parallel?

I am trying to create a Camel route that will process incoming IMAP messages in parallel. The mail component should distribute incoming mails to different threads (but every message should pass the two process steps in order).

Something like this:

from("imap://...")
    .threads(4)
    .process(new FirstProcessor())
    .process(new SecondProcessor());

This seems to send new message to different threads, but not in parallel (thread n+1 starts after thread n finishes). How can I achieve parallel processing here?

Upvotes: 0

Views: 387

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55555

This is not supported by the camel-mail consumer. It processes the mails in sequence using the same thread on the consumer side.

You need to use wireTap or store the message to a seda queue in no wait mode etc.

Upvotes: 1

Related Questions