camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raul Kripalani <>
Subject Re: What is the best approach to do an "asynchronous rendezvous"?
Date Wed, 15 May 2013 19:46:08 GMT
Hi Chris,

I like this kind of problems ;-) Do these two messages share a correlation

If yes, you can create a bean which acts like a Repository, accumulating
message bodies or Exchanges under the correlation key. Could be implemented
using Guava's MultiMap, or a DB if you need durable persistence, or a
distributed cache if you require clustering without persistence.

When a message arrives, you query the Repository for a previous message
with the same correlation key. If it exists, you pick it up, do whatever
manipulation is needed, and release the 3rd event. Kind of like a
CyclicBarrier that stores the messages for later usage.

P.S.: You could consider using the Aggregator EIP, but it'll block a thread
until the 2nd event comes through.


*Raúl Kripalani*
Enterprise Architect, Open Source Integration specialist, Program
Manager | Apache
Camel Committer | | twitter: @raulvk

On Wed, May 15, 2013 at 6:56 PM, Chris Wolf <> wrote:

> In my process, I have two events that must be completed before the
> third can proceed.
> One event is the arrival of a certain JMS message and the other is the
> arrival of
> a certain file type.  The problem is, I cannot represent this in a
> route pipeline because
> one event may occur before the other and it's totally random from one
> run to another.
> In the abstract, I'm thinking one of the EIP patterns, either
> "resequencer" or "scatter-gather"
> applies, but I'm not certain how to do this in a concrete way with
> Camel.  If anyone has
> ideas, that would be great...
> Thanks,
> Chris

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message