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

   Follows [CAMEL-27366](https://issues.apache.org/jira/browse/CAMEL-27366), 
merged on Camel main for 4.24.0. That fix changes how camel-mllp chooses a 
charset:
   
   - A message is encoded in the charset of its MSH-18 field, and in the 
endpoint's `charsetName` when MSH-18 is empty.
   - The consumer no longer sets the `CamelCharsetName` exchange property for a 
String body.
   - A `CamelCharsetName` header no longer overrides the producer.
   - `CamelMllpCharset` holds MSH-18, not `charsetName`.
   
   ## Changes
   
   - **mllp-source:** the `removeProperty: CamelCharsetName` step is removed. 
It existed because the component marked every message with its charset 
(ISO-8859-1 by default), which then turned the text into bytes in that charset 
later in the flow.
     - The Output now lists `CamelMllpCharset` (MSH-18, such as `UNICODE 
UTF-8`), and it is declared in `dataTypes`.
   - **mllp-sink:** the `removeHeader: CamelCharsetName` and `setProperty: 
CamelCharsetName` steps are removed.
     - The Input and `charset` descriptions now say that text is sent in the 
charset of MSH-18, and in `charset` only when MSH-18 is empty. Before, they 
said "it is not read from the message".
     - "Good to know" no longer says `CamelCharsetName` is removed. It says 
that this header does not change the charset.
   
   ## Tests
   
   Local `MllpIT`: **1 test, 1 passed**. All the existing cases are kept. New 
checks:
   
   - The sink sends MSG00006, a UTF-8 message marked `UNICODE UTF-8` in MSH-18, 
with **no `charset` set** and a `CamelCharsetName: ISO-8859-1` header. The 
source reads `Sørensen^Łucja`, and the body is 126 bytes as UTF-8.
   - `CamelMllpCharset` is `UNICODE UTF-8` for MSG00006, and is not set for 
MSG00001, which has no MSH-18.
   - MSG00002 still gives 126 bytes after `convertBodyTo byte[]` in the flow of 
the source. This shows the consumer no longer sets the ISO-8859-1 exchange 
property, now that the `removeProperty` workaround is gone.
   
   ## Upgrade note
   
   ```
   * `mllp-sink` sends a message in the charset its MSH-18 field names (such as 
`UNICODE UTF-8`), and uses `charset` only when MSH-18 is empty; before, it 
always used `charset` (ISO-8859-1 by default). `mllp-source` sets the header 
`CamelMllpCharset` to MSH-18.
   ```
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
   


-- 
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