java - Dynamic to(URI) in Camel -
i'd configure camel route to(uri)
can specified @ runtime.
i tried following:
public class foo extends routebuilder { @override public void configure() { // uri can point different hosts from("direct:start").to(${someuri}"); } }
and then
producertemplate pt = camelcontext.createproducertemplate(); pt.requestbodyandheader("direct:start", "someuri", "http://example.com");
however above doesn't work (camel complains not having default endpoint).
what's best way go this?
see these links reference:
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
http://camel.apache.org/recipient-list.html
for example, see unit test
Comments
Post a Comment