Apache Camel : "direct:start" endpoint - what does it mean ?

Soumya Simanta picture Soumya Simanta · Mar 9, 2012 · Viewed 39.5k times · Source

I'm new to Apache Camel. Can someone explain what "direct:start" means in Camel. Please see

http://camel.apache.org/http

from("direct:start")
.to("http://myhost/mypath");

Thanks.

Answer

gregwhitaker picture gregwhitaker · Mar 9, 2012

The "direct:start" above is simply saying that the route starts with a Direct Component named "start".

The direct endpoint provides synchronous invocation of a route. If you want to send an Exchange to the direct:start endpoint you would create a ProducerTemplate and use the various send methods.

ProducerTemplate template = context.createProducerTemplate();

template.sendBody("direct:start", "This is a test message");

There is nothing special about the name start. It is simply the name you are going to use when referring to the endpoint and could have just as easily been direct:foo.