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 03624106D0 for ; Sun, 19 Jan 2014 00:33:28 +0000 (UTC) Received: (qmail 74538 invoked by uid 500); 19 Jan 2014 00:33:26 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 74463 invoked by uid 500); 19 Jan 2014 00:33:26 -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 74455 invoked by uid 99); 19 Jan 2014 00:33:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Jan 2014 00:33:26 +0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Jan 2014 00:33:21 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1W4gJv-0000a2-Qr for users@camel.apache.org; Sat, 18 Jan 2014 16:32:59 -0800 Date: Sat, 18 Jan 2014 16:32:59 -0800 (PST) From: ABouchama To: users@camel.apache.org Message-ID: <1390091579802-5746210.post@n5.nabble.com> Subject: Dysfunction of recipientList with 2 same endpoints in the List (using onPrepareRef) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Dear all, [project available in this link with unit test : https://github.com/abouchama/camel_recipientList ] The problem: we send a message the direct=recipientList, the message should be sent 2 times to the direct A, and 1 to the direct B, and we should have the following result (the project in the attach of this ticket with unit test ): 1. Msg = should be in the direct A, with header invoked=0 2. Msg = should be in the direct B, with header invoked=1 3. Msg = should be in the direct A, with header invoked=2 But we have this : 1. Msg = should be in the direct A, with header invoked=2 2. Msg = should be in the direct B, with header invoked=1 3. Msg = should be in the direct A, with header invoked=2 We use the following route: direct://A,direct://B,direct://A
recipients
With the following class: public void process(Exchange exchange) throws Exception { String recipients = (String) exchange.getIn().getHeader("recipients"); String toEndpoint = (String) exchange.getProperty(Exchange.TO_ENDPOINT); String[] Recipients = recipients.split(","); for (int i = 0; i < Recipients.length; i++) { if (toEndpoint.equalsIgnoreCase(Recipients[i])) { exchange.getIn().setHeader("invoked", i); } } Thanks in advance -- View this message in context: http://camel.465427.n5.nabble.com/Dysfunction-of-recipientList-with-2-same-endpoints-in-the-List-using-onPrepareRef-tp5746210.html Sent from the Camel - Users mailing list archive at Nabble.com.