Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ECBEDD089 for ; Wed, 15 May 2013 19:46:55 +0000 (UTC) Received: (qmail 72507 invoked by uid 500); 15 May 2013 19:46:55 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 72471 invoked by uid 500); 15 May 2013 19:46:55 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 72455 invoked by uid 99); 15 May 2013 19:46:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 May 2013 19:46:55 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of raul@evosent.com designates 209.85.192.171 as permitted sender) Received: from [209.85.192.171] (HELO mail-pd0-f171.google.com) (209.85.192.171) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 May 2013 19:46:49 +0000 Received: by mail-pd0-f171.google.com with SMTP id r11so1663031pdi.2 for ; Wed, 15 May 2013 12:46:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-originating-ip:in-reply-to:references :from:date:message-id:subject:to:content-type:x-gm-message-state; bh=gRnWEcAC92LtwPclIvTEV7+hrcZHX1BC5eRdRuCR4d0=; b=PDMtGqmga1BqsDr8qSbI2SQyOF1Ws/oofNpycg7fmuppB4TyithV/D8Ft5o7rA0LOv BTI7WKroG5FX/o0XS68ixETnQahTnyScevYo08hcZJF3o1AYwwRVrF2OeXHrzbIoTLby xTvaigmaNilJ8sosJj1UVNSccKKqUXHraIQiaUwvqBSiaOCuUDUtYH8g++R+8K5ID95P R1IEpFwxZNs6OeM2ccRt1qlT6t4Y9YByRda9Ru77XQ+fI54mispgMax+gGkIW8TiApf9 jITjntfOF1FK020nkIJvr9zztNBl+hVndeeIXid+38OHTUBsCicN3of9/bqb1i77N8YG 1COQ== X-Received: by 10.68.91.131 with SMTP id ce3mr39874077pbb.46.1368647188514; Wed, 15 May 2013 12:46:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.70.35.101 with HTTP; Wed, 15 May 2013 12:46:08 -0700 (PDT) X-Originating-IP: [85.155.77.52] In-Reply-To: References: From: Raul Kripalani Date: Wed, 15 May 2013 20:46:08 +0100 Message-ID: Subject: Re: What is the best approach to do an "asynchronous rendezvous"? To: "users@camel.apache.org" Content-Type: multipart/alternative; boundary=047d7b6dc2767e9bc004dcc70165 X-Gm-Message-State: ALoCoQms/2kProqoiSa/L9ENiwv7809T225x9tJNkB5VFY0CnvuWt1J/46nY4UsG8SaSgVEiIrpA X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6dc2767e9bc004dcc70165 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Chris, I like this kind of problems ;-) Do these two messages share a correlation key? 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. Regards, *Ra=FAl Kripalani* Enterprise Architect, Open Source Integration specialist, Program Manager | Apache Camel Committer http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani http://blog.raulkr.net | 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 > --047d7b6dc2767e9bc004dcc70165--