You need some message producer in your route to emit Exchange
that would trigger the http component. Your route starts with direct:start
which cannot emit new Exchange
s, it just sits and waits for someone to initiate the process.
The easiest way to make your route work is to replace direct:start
with some producer. For instance, replacing it with this timer .from("timer://foo?fixedRate=true&period=10000")
will trigger your http-request once every 10 seconds.
If you want to initiate the request manually, you need to create a ProducerTemplate
and use it to send a message to direct:start
. That would be:
ProducerTemplate template = context.createProducerTemplate();template.sendMessage("direct:start", "Message body");