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 6BCB010FA6 for ; Tue, 21 Jan 2014 13:12:52 +0000 (UTC) Received: (qmail 26838 invoked by uid 500); 21 Jan 2014 13:12:51 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 26782 invoked by uid 500); 21 Jan 2014 13:12:50 -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 26743 invoked by uid 99); 21 Jan 2014 13:12:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jan 2014 13:12:49 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of atanas.shindov@gmail.com does not designate 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jan 2014 13:12:43 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1W5b7u-0003fd-Ra for users@camel.apache.org; Tue, 21 Jan 2014 05:12:22 -0800 Date: Tue, 21 Jan 2014 05:12:22 -0800 (PST) From: shindito To: users@camel.apache.org Message-ID: <1390309942845-5746278.post@n5.nabble.com> Subject: Avoiding duplicate messages MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi guys, consider the following route: from(srcEndpoint). to(destEndpoint1). to(destEndpoint2) I have a Java program which does the following: - create a Camel exchange, add an onComplition action to remove the exchange from the cache on success, store the exchange in a cache, and then send it to the srcEndpoint. The camel route takes it from there and delivers the exchange to destEndpoint1 and destEndpoint2. If the JVM crashes between destEndpoint1 and destEndpoint2, then I make a flush which: - gets the Exchange from the cache and sends it to srcEndpoint. My question is: What is the Camel way to prevent destEndpoint1 from receiving the same exchange twice (as it was already received before the JVM crash)? Please note that there might be more then two destination endpoints in the route. Is it possible to instruct the route not to deliver the message to endpoints that have already received (acknowledged) it? Is this an exchange configuration? If there is no Camel feature that would do this for me, what is your recommendation: where should I plug-in my custom logic to perform what's necessary to avoid duplicate messages? Best regards, Atanas -- View this message in context: http://camel.465427.n5.nabble.com/Avoiding-duplicate-messages-tp5746278.html Sent from the Camel - Users mailing list archive at Nabble.com.