The message (header) or exchange (property) is the right place to "store state" which is related to this exchange/message. Not all protocols support the exchange properties during routing, E.G. for JMS, you have to use the "transferExchange" [1] to not lose your exchange properties (and they must serializable). If you lose your headers, you should have a look at [2].
[1] http://camel.apache.org/jms.html [2] http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html Best, Christian On Tue, Apr 17, 2012 at 7:22 PM, Markus Wolf <markus.w...@sinnerschrader.com > wrote: > Hi, > > I'm looking for an example of a stateful dynamic router. > The given example on the webpage notes that it is not thread safe. But when > I try to set a property or header on the exchange it is thrown away, > because I guess the exchanged is copied and not put in as reference. > > Any help is appreciated. > > Regards > Markus > -- > Markus Wolf, Technical Director > markus.w...@sinnerschrader.com > > T +49.40.398855-324 | F +49.40.398855-55 > > SinnerSchrader Deutschland GmbH > Völckersstraße 38, 22765 Hamburg > Amtsgericht Hamburg HRB-Nr. 63663 > Geschäftsführer: Matthias Schrader (Sprecher), Holger Blank, > Thomas Dyckhoff, Blundstone Osterberger, Chris Wallon > Büros: Hamburg, Frankfurt am Main > > http://www.sinnerschrader.de | Creating Radical Relationships. >