What Camel version do you use? And what data do you send to the seda endpoint? Is it by any chance a shared object instance? Or are you sure they are totally indepedent objects?
On Tue, Mar 4, 2014 at 11:14 AM, simafengyun <yifeng....@citi.com> wrote: > Hi, > > Below case is not thread safe because marshal is not thread safe. Is there > anybody know how to fix it? > > Case as below > > * <endpoint id="toMarshal" > > uri="seda:toMarshal?multipleConsumers=false&concurrentConsumers=5" />* > > <dataFormats> > <jaxb id="MarketData" prettyPrint="true" > contextPath="com.rr.md.tt.entity" encoding="UTF-8" /> > </dataFormats> > > <camel:route id="marketDataRoute"> > <from ref="marketDataQueue" /> > <to uri="toMarshal" /> > </camel:route> > <camel:route id="jaxbRoute"> > <from uri="toMarshal" /> > *<marshal ref="MarketData" />* > <to uri="file:outbox?" /> > </camel:route> > > Issue: the route jaxbRoute get data from seda:toMarshal whose > concurrentConsumers > 1, then marshal the data to XML by 5 threads. And I > found the some xml file's content in the outbox is not correct because the > marshal is not thread-safe. I tried to config the element marshal's > attribute scope to "prototype". But it doesn't support the scope attribute. > Do you know how to make it thread safe in this case? > > > > > > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/jaxb-non-thread-safe-issue-tp5748274.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen Make your Camel applications look hawt, try: http://hawt.io