简体   繁体   中英

Camel Producer template in a custom AsyncProcessor

I have created a custom endpoint to leveraging asynchronous processing of some data. Now I want to communicate the result of the processing to another route so the result can be saved in a database but I don't know how I can get access to a producer template within my AsyncProcessor.

Any help will be greatly appreciated.

See this FAQ about using a producer template: http://camel.apache.org/why-does-camel-use-too-many-threads-with-producertemplate.html

The intend is to IoC the producer template / or lookup the template when you need it. You can also get hold of the CamelContext API from the Exchange and then create a new producer template to use (only once) and keep reusing the template. If you do not want to reuse the template, then make sure to stop it after usage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM