Hello,
I have the Camel + Spring + SpringBoot combo working
I have my RouteBilder Spring Component that's being pickup up and started
during Spring startup.
The route starts fine as I can see SpringCamelContext output in the logs.
What I am trying to do is to send a message to direct endpoint using
injected ProducerTemplate but if I do it like this
@Produce(uri = "direct:myQueue")
private ProducerTemplate producerTemplate;
@EventListener(ContextRefreshedEvent.class)
public void send()
throws Exception
{
producerTemplate.start();
producerTemplate.sendBody("hello");
}
I am getting
No consumers available on endpoint: direct://myQueue
because the route has not started yet and if I try blocking parameter on
uri like this:
@Produce(uri = "direct:myQueue?block=true")
then the whole thing freezes for 30 secs (default timeout) and then blows
up with the same exception
I also tried to call the producerTemplate.sendBody() form @PostConstruct
annotaded method with the same effect.
How do I wait for the CamelContext to be fully started in this context????
Cheerio
Arur