[ 
https://issues.apache.org/jira/browse/CAMEL-10820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15897073#comment-15897073
 ] 

Luca Burgazzoli edited comment on CAMEL-10820 at 3/6/17 2:28 PM:
-----------------------------------------------------------------

I changed a little bit producer template so that it copies the body and headers 
when doing async stuffs, the changes are there: 
https://github.com/lburgazzoli/apache-camel/commit/e329eabfe98f5ecab7fe50737567a0a921442325


[~jub] do you mind having a look ?


was (Author: lb):
I changed a little bit producer template so that it copies the body and headers 
when doing async stuffs, the changes are there: 
https://github.com/lburgazzoli/apache-camel/commit/8480f88ea3795bb024fb4b0c9646c9a10cff42c8.


[~jub] do you mind having a look ?

> DefaultFluentProducerTemplate mixes up data when sending asynchronously
> -----------------------------------------------------------------------
>
>                 Key: CAMEL-10820
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10820
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.18.2
>         Environment: eclipse, win7, gradle
>            Reporter: Jakub Cernohorsky
>            Assignee: Luca Burgazzoli
>             Fix For: 2.18.4, 2.19.0
>
>         Attachments: default_fluent_producer_template.diff
>
>
> DefaultFluentProducerTemplate
> code:
> producer = context.createFluentProducerTemplate();
> future1 = producer.withHeader("action", 
> "register").withBody(body1).asyncSend();
> future2 = producer.withHeader("action", 
> "register").withBody(body2).asyncSend();
> These two subsequent calls produces with the default creation two calls with 
> the same body - body2.
> The cause is that it uses default processor supplier () -> 
> this::populateExchange which is call lazily at the time of send and at that 
> time the body property of DefaultFluentProducerTemplate is body2.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to