Hello camel-breeders!
We are trying to poll a huge amount of files by the jbi:file component. All
these files are processed by a custom processor during the next step:
from("jbi:endpoint:http://myCompany.net/InboundRoutingService/EDIFileInEndpoint")
.intercept(new StreamCachingInterceptor())
.process(new DataProcessor(new EdiPreProcessor(),
DataProcessor.ATTACHMENT_TO_BODY))
There is a problem with the custom EdiPreProcessor. It's job is quite
simple. It has to wrap the incoming data in xml and to extract some
header-data to xml-attributes. Most times, it runs well and there is no
problem. But if you put a lot of files into the polling-directory, there are
exceptions thrown.
We debugged and saw that there are multiple threads of this
processor-instance running in case of multiple files to process... and if
one of these threads changes a global boolean attribute of the processor
object, this attribute is changed in every other thread as well.
I already tried some experiments with "volatile" or "synchronized" keywords,
but all of them failed. I just want that every single thread has it's own
attributes.
Is there a way to do this from camel's point of view? Or how would you solve
this problem?
thx in advance for your help
--
View this message in context:
http://www.nabble.com/Threading-issue-with-processors-tp20661633s22882p20661633.html
Sent from the Camel - Users mailing list archive at Nabble.com.