How to trigger Apache camel route from my java method
问题 I am new to Apache Camel. My requirement is to trigger an Apache camel route in my code flow from method A(). Also I need to pass the object param of A() to the route. I do not want to use amq, file etc components. code : public void A(MyObjectType param) { //Need to call camel route with "param" } What's the best way to do this? 回答1: You can use the ProducerTemplate option, ProducerTemplate template = exchange.getContext().createProducerTemplate() and then you can do template.sendBody The