[ https://issues.apache.org/jira/browse/CAMEL-12638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16572838#comment-16572838 ]
ASF GitHub Bot commented on CAMEL-12638: ---------------------------------------- GitHub user davsclaus opened a pull request: https://github.com/apache/camel/pull/2459 CAMEL-12638: FluentProducerTemplate should be thread-safe You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/camel camel-12638 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/camel/pull/2459.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2459 ---- commit afedbc78afde861075ec218e50eaff12e2b9c7fc Author: Claus Ibsen <claus.ibsen@...> Date: 2018-08-08T07:57:57Z CAMEL-12638: FluentProducerTemplate should be thread-safe. commit efc0e955139565f49f3f6ffd357ba78fa288efcc Author: Claus Ibsen <claus.ibsen@...> Date: 2018-08-08T07:59:46Z CAMEL-12638: FluentProducerTemplate should be thread-safe. ---- > DefaultFluentProducerTemplate is not thread safe > ------------------------------------------------ > > Key: CAMEL-12638 > URL: https://issues.apache.org/jira/browse/CAMEL-12638 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.20.2 > Reporter: Lukasz > Priority: Major > Fix For: 2.23.0 > > Attachments: image-2018-07-12-17-58-09-225.png > > > I think we have rediscovered the CAMEL-10820 bug. A body of one request gets > replaced with a body of proceeding request, in our case we use *request()* > method instead of *asyncSend()*. > We use camel together with spring-boot. Consider following code: > > {code:java} > @Service > public class UseCamelService { > private FluentProducerTemplate producer; > @Autowired > public UseCamelService(FluentProducerTemplate producer) { > this.producer = producer; > } > public String getValueFromCamel(String body) { > return producer.to("route").withBody(body).request(String.class); > } > } > {code} > If *UseCamelService.getValueFromCamel()* gets called from two different > threads it is possible for the latter one to override the body of the first > one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)