[ 
https://issues.apache.org/jira/browse/CAMEL-17563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-17563:
--------------------------------
    Fix Version/s: 3.16.0

> wireTap doesn't deep copy attachments
> -------------------------------------
>
>                 Key: CAMEL-17563
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17563
>             Project: Camel
>          Issue Type: Improvement
>          Components: came-core
>    Affects Versions: 3.14.0
>            Reporter: Yasser Zamani
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 3.16.0
>
>
> Attachments are just stored in a Map in an internal property of exchange. So 
> when Camel copies exchange on wireTap, Attachments is copied by reference and 
> so are shared with the main route and so confusing un-deterministic behavior 
> will emerge on wireTap when exchange has attachments!
> Currently I've workaround this issue as following:
> {code:java}
>                     
> .wireTap("direct:xslt-validation-logging").onPrepare(exchange -> {
>                         // deep copy attachments to avoid wiretap added 
> attachments to be seen in the original route
>                         AttachmentMessage attMsg = 
> exchange.getIn(AttachmentMessage.class);
>                         attMsg.setAttachments(attMsg.getAttachments());
>                     }).end()
> {code}
> but I think Camel internally MUST do this for me as it's useless to share 
> attachments with main route I think.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to