armandino armandino - 1 year ago 88
Java Question

Dynamic to(URI) in Camel

I'd like configure a Camel route where the

can be specified at runtime.

I tried the following:

public class Foo extends RouteBuilder {
public void configure() {
// the URI can point to different hosts

and then

ProducerTemplate pt = camelContext.createProducerTemplate();
pt.requestBodyAndHeader("direct:start", "someUri", "");

However the above doesn't work (Camel complains about not having a default Endpoint).

What's the best way to go about this?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download