As Camel create the bean instance when it setup the method expression so your bean method should be stateless. Please store the context information into the message header or exchange property.
-- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On June 13, 2014 at 6:03:49 PM, cgiera ([email protected]) wrote: > Hello, > > most of our routes contain a split with bean functionallity. > > For example: > .split().method(Myclass.class.getName(), "method") > or > .split(bean(MyClass.class.getName(), "method")) > > Sometimes we got strange behavior in this routes and now I've found why: > Although the bean MyClass was given to the splitter as "beanRef", the > behavior is like a singleton. > > I've tried a lot of variants of split().method, split(bean(....)), bean as > string, class, object(=instance) but the bean MyClass everytime had the same > instance. > > Maybe I've missed something, but I think that's not the way it should > behave. > > Am I wrong with this? > > kind regards, > Christoph > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/split-with-bean-multithreading-problem-tp5752258.html > > Sent from the Camel - Users mailing list archive at Nabble.com. >
