camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edhansen42 <>
Subject EventNotifierSupport and Threads
Date Sat, 02 Apr 2016 06:29:27 GMT
Camel 2.15.2
We are having a bit of a problem with EventNotifierSupport events and
Our goal is to isolate our business logic code from frameworks as much as
possible.  To do so, we inject a bean into the business logic code that
provides proxy methods to access information stored in the Exchange.
The Bean class has a thread local that stores Exchanges.
When an ExchangeCreatedEvent occurs, we invoke a method on the bean that
stores the passed in Exchange in the thread local for that thread.
When an ExchangeCompletedEvent occurs, we invoke a method on the bean to
clear out its thread local for that thread.
The problem we're seeing is that the thread on which the
ExchangeCompletedEvent occurs doesn't match the thread on which the
ExchangeCreatedEvent occurs.  So when we clear out the thread local for the
ExchangeCompletedEvent thread, we remove the wrong Exchange.

Is what we're doing just plain wrong?  Is Camel managing threads in a way
that makes what we intended impossible? 

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message