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 95428F596 for ; Wed, 20 Mar 2013 20:35:59 +0000 (UTC) Received: (qmail 951 invoked by uid 500); 20 Mar 2013 20:35:59 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 927 invoked by uid 500); 20 Mar 2013 20:35:59 -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 918 invoked by uid 99); 20 Mar 2013 20:35:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Mar 2013 20:35:58 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.236.26 is neither permitted nor denied by domain of ramukhsohtnas.g@gmail.com) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Mar 2013 20:35:54 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1UIPjR-0002Sq-91 for users@camel.apache.org; Wed, 20 Mar 2013 13:35:33 -0700 Date: Wed, 20 Mar 2013 13:35:33 -0700 (PDT) From: santhosh To: users@camel.apache.org Message-ID: <1363811733272-5729568.post@n5.nabble.com> In-Reply-To: <1363800253283-5729549.post@n5.nabble.com> References: <1363739318515-5729462.post@n5.nabble.com> <1363800253283-5729549.post@n5.nabble.com> Subject: Re: Camel receipient list with interceptor MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I will answer this question myself .You can find the endpoint which the exchange is used by using exchange.getProperty("CamelToEndpoint") . To answer the overall question - how to manipulate the message in recipient/multicast according to endpoint keeping in mind the endpoint list will be created dynamically at runtime.What it means is we would know which endpoints the message needs to be mulitcasted only at runtime and before it gets sent we need to perform endpoint specific message manipulation.
endpointList
The below class is just an idea out of my mind.in real use case the recipient list will be populated dynamically and the exchange body manipulation will be dynamic.I dont know if this is the recommended way but i think it will work .Please let me know if see any obvious problems public class CustomExchangeMessage implements Processor { public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); String toEndpoint=exchange.getProperty("CamelToEndpoint"); //this is a simple if now .but this will be where the dynamic part willl kick in. if(toEndpoint.equalsIgnoreCase("A")) { //manipulate the body for endpoint A } if(toEndpoint.equalsIgnoreCase("B")) { //manipulate the body for endpoint B } } } This question has been answered and can be closed. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-receipient-list-with-interceptor-tp5729462p5729568.html Sent from the Camel - Users mailing list archive at Nabble.com.