camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: jaxb non-thread safe issue
Date Tue, 04 Mar 2014 12:22:03 GMT
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.guo@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&amp;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: cibsen@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

Mime
View raw message