Reputation: 302
I am not sure how many people have had a chance to deal with Camel Processors. So this is my concern:
I am obtaining some information and sending it to the processor. From the processor, it makes a database call via service and inserts a record. I am using a POJO and setting the values in my model in the processor via the exchange object. I am not at all facing any issues but processor is not meant for setting values in a list or any other structure. It should simply do some processing over the exchange object and pass it on primarily due to the fact that there might be a situation where multiple threads could call the same processor.
This is what I would like to know:
Upvotes: 1
Views: 1704
Reputation: 21015
Processors
are singletons and therefore shouldn't be used to store state of any type...
some options...
store state information in the Exchange
properties or Body headers
replace a Processor
with a Bean
where you can manage the scope (prototype, etc)
use ThreadLocal
variables for non thread safe references
Upvotes: 3