Claus Ibsen created CAMEL-27366:
-----------------------------------

             Summary: camel-mllp - the charset of a message: the producer 
ignores MSH-18, the CamelCharsetName exchange property wins over charsetName, 
and the CamelMllpCharset header is not MSH-18
                 Key: CAMEL-27366
                 URL: https://issues.apache.org/jira/browse/CAMEL-27366
             Project: Camel
          Issue Type: Bug
          Components: camel-mllp
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Three related charset problems:

# *The producer ignores MSH-18 when it encodes text.* It takes the charset from 
the {{CamelCharsetName}} header, then the exchange property, then 
{{charsetName}}, but never from MSH-18 of the message, while the consumer 
decodes by MSH-18. A message marked {{UNICODE UTF-8}} in MSH-18 and sent with 
the default charset arrives broken ({{S�rensen}}, {{?ucja}}).
# *The CamelCharsetName exchange property wins over the endpoint's 
charsetName.* The consumer always sets it (ISO-8859-1 by default), and the 
producer sets it after each send. So in a route from an mllp consumer to an 
mllp producer, the producer's {{charsetName}} is ignored. Later steps of the 
route also turn the text into bytes in ISO-8859-1, so characters outside it 
become {{?}}.
# *The CamelMllpCharset header does not hold MSH-18,* as the catalog describes 
it ("MSH-18 value"). It holds the configured charset name, ISO_8859_1 by 
default.

Expected: the producer encodes by MSH-18 when the message has one, then by its 
own {{charsetName}}; the consumer does not leak its charset to other endpoints 
through the exchange property; {{CamelMllpCharset}} holds MSH-18, or its 
description is changed.

(The new Kamelets {{mllp-source}} and {{mllp-sink}} work around 1 and 2 in 
their templates.)

Found while adding new Kamelets to the Kamelet catalog (apache/camel-kamelets, 
2026-11-21).



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to