Reputation: 79
I need to add a dynamically changing value to camel 'to' endpoint url as below.
from("direct:getNewData")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
}})
.to("http://dummyhost/12345");
How am I pass and set 12345 value to change dynamically in route endpoint url from java service?
Upvotes: 3
Views: 3286
Reputation: 21015
I generally just use a simple expression with the recipient list pattern...with this its easy to dynamically construct a URI based on a message header value...
from("direct:getNewData")
.recipientList(simple("http://dummyhost/${header.foo}"));
Upvotes: 4