Affects Version/s: 3.7.0
Fix Version/s: None
I'm currently reading about error handling in Camel, specifically Using a Processor as a failure handler.
The code example lists
According to the Javadoc of createProducerTemplate() and ProducerTemplate this is problematic:
- stop() must be called when the ProducerTemplate is not further needed
- Recommended practice is to use just one ProducerTemplate in the application
- Why does Camel use too many threads with ProducerTemplate?
Since we're all lazy devs, we tend to copy paste code listings and think we're done.
I suggest the following:
- Add a section Recommended Practice to user manual ProducerTemplate which basically lists the important bits of FAQ article Why does Camel use too many threads with ProducerTemplate?
- Fix code example in Using a Processor as a failure handler.
- Maybe scan through other code samples?