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

https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/recipientlisttest.java


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -