[
https://issues.apache.org/jira/browse/CAMEL-12638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16543618#comment-16543618
]
Mario Papandrea edited comment on CAMEL-12638 at 7/13/18 7:33 PM:
------------------------------------------------------------------
Ah yes sure, sorry! I was hoping exists some scope crating a new instance for
each call, but is not like this. Anyway my suggestion to remove from the
camel-spring-boot-starter configuration as a singleton is still valid. It
shouldn't be used that way and the fact that you can find it in the spring
context available for injection is error prone. This class must be instantiated
each time is used so there is no need to be provided by the container
was (Author: mario.papandrea):
Ah yes sure, sorry! I was hoping exists some scope crating a new instance for
each call, but is not like this. Anyway my suggestion to remove from the
camel-spring-boot-starter confoguration is still valid. It shouldn't be used
that way.
> 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
> 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)