davsclaus opened a new pull request, #25388:
URL: https://github.com/apache/camel/pull/25388

   ## Summary
   
   _Claude Code on behalf of davsclaus_
   
   Since [CAMEL-21755](https://issues.apache.org/jira/browse/CAMEL-21755) 
(released in 4.10.1) moved attachment storage from Exchange-level safe-copy 
properties to Message-level traits (`MessageTrait.ATTACHMENTS`), any producer 
that creates a fresh OUT message via `exchange.getOut()` silently drops 
attachments. This affects camel-http (reported in 
[CAMEL-24364](https://issues.apache.org/jira/browse/CAMEL-24364)) and ~127 
other producers across 30+ components.
   
   **Root cause:** `AbstractExchange.newOutMessage()` calls `in.newInstance()` 
which returns a blank message with no traits. Before 4.10.1, attachments lived 
on the Exchange and were naturally shared; after the trait migration, they're 
silently lost.
   
   **Fix:**
   - Copy the `ATTACHMENTS` trait from IN to the new OUT message in 
`AbstractExchange.newOutMessage()`, restoring the pre-4.10.1 semantics
   - Remove the per-component workaround added in 
[CAMEL-23193](https://issues.apache.org/jira/browse/CAMEL-23193) for 
`JmsMessage.copyFrom()`
   - Add a regression test that reproduces the exact bug
   
   ## Test plan
   
   - [x] New `AttachmentOnOutMessageTest` reproduces the bug (attachment on IN, 
fresh OUT via `exchange.getOut()`, verify attachment survives)
   - [x] All existing camel-attachments tests pass
   - [x] camel-jms compiles cleanly after removing workaround


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to