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.

Reply via email to