camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From santhosh <>
Subject Re: Camel receipient list with interceptor
Date Wed, 20 Mar 2013 20:35:33 GMT
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.

					<recipientList parallelProcessing="true" streaming="true"
						id="recipientList" strategyRef="StringAggregationStrategy"
						timeout="2500" onPrepareRef="CustomExchangeMessage"  delimiter=","



The below class is just an idea out of my 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.        
                           //manipulate the body for endpoint A 
                         //manipulate the body for endpoint B



This question has been answered and can be closed.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message