I am not able to set the default endpoint using annotation. As per the camel docs, it recommends annotation as shown below.
// auto wiring a producer template using endpoint annotation
@Autowired
@EndpointInject(uri="direct:start")
private ProducerTemplate producerTemplate;
// send the body
producerTemplate.sendBody("hi");
Doesn't work. It still complains
"Exception: defaultEndpoint must be specified"
You can specify the defaultEndpoint on the ProducerTemplate itself, so something like:
// set the defautlEndPoint
producerTemplate.setDefaultEndpointUri("direct:start");
// send the body
producerTemplate.sendBody("hi");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With