On Fri, Oct 28, 2011 at 5:37 PM, Donald Whytock <[email protected]> wrote:
> When you say "between exchanges", you mean you need access to the data
> in a processor regardless of what exchange the processor is handling?
>
> Would this be easier with a static field in the processor?
>

Yeah Camel creates a new Exchange for each new message and there is no
way to automatically share state from previous exchange to the next
etc.

You can as suggested use a static field, or store the state in the registry.
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/Registry.html

If you use Spring XML then you can define a <bean> in the XML file and
lookup the bean using the registry.



> Don
>
> On Fri, Oct 28, 2011 at 11:34 AM, Romain Manni-Bucau
> <[email protected]> wrote:
>> Hi,
>>
>> Try properties instead pf headers. It is the main diffrence between both.
>>
>> - Romain
>>
>> Le 28 oct. 2011 17:25, "ychawla" <[email protected]> a écrit :
>>
>>> Hello All,
>>> I frequently set headers on an exchange so I can access them at different
>>> points on a route.  Is there a way to persist a variable between different
>>> exchanges?
>>>
>>> I have a timer that will query a database every minute.  I want to store
>>> the
>>> last record I queried so I only get new records.  I don't have access to
>>> write to the database so I can't use that to persist this info.  I could
>>> write it out to a text file and read/write it.  Is there a way to store
>>> this
>>> information in Camel so it can be available to different exchanges?
>>>
>>> Thanks,
>>> Yogesh
>>>
>>> --
>>> View this message in context:
>>> http://camel.465427.n5.nabble.com/Persisting-a-variable-over-different-exchanges-tp4946317p4946317.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to