Character encoding Apache Camel:错误WMQMsg-应为MQ消息字符集';819';,但收到';1208';

Character encoding Apache Camel:错误WMQMsg-应为MQ消息字符集';819';,但收到';1208';,character-encoding,apache-camel,ibm-mq,Character Encoding,Apache Camel,Ibm Mq,目前我正在与ApacheCamel合作,并尝试编写WMQ。但是,不幸的是,我犯了以上的错误。我发现要解决这个问题,我需要将字符集或编码转换为“819”或“ISO-8859-1”。但是,我不知道如何在ApacheCamel中这样做 仅供参考,以下是我的路线配置: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="

目前我正在与ApacheCamel合作,并尝试编写WMQ。但是,不幸的是,我犯了以上的错误。我发现要解决这个问题,我需要将字符集或编码转换为“819”或“ISO-8859-1”。但是,我不知道如何在ApacheCamel中这样做

仅供参考,以下是我的路线配置:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:p="http://www.springframework.org/schema/p" default-init-method="init" xmlns:util="http://www.springframework.org/schema/util" xmlns:osgi="http://www.springframework.org/schema/osgi" xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xs http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/osgi  http://www.springframework.org/schema/osgi/spring-osgi.xsd">

    <import resource="classpath:/META-INF/spring/components.xml"/>

    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">

        <route>
            <from uri="jetty:http://localhost:8888/uebermittleAusweisdaten"/>
            <process ref="TransformToXML"/>
            <to uri ="xslt:mobako.sender.xsl"/>
            <setHeader headerName="CamelJmsDestinationName">
                <constant>queue:///LSMH.ZKSEAP.SERVICEBUS?targetClient=1</constant>    
            </setHeader>
            <to uri="jms:queue:LSMH.ZKSEAP.SERVICEBUS"/>
        </route>
        <route>
            <from uri="jms:queue:ZKSEAP.LSMH.SERVICEBUS"/>
            <to uri="stream:out"/>
        </route>

    </camelContext>

</beans>

queue:///LSMH.ZKSEAP.SERVICEBUS?targetClient=1    

谢谢您的帮助。

您可以这样更改编码:

<convertBodyTo type="java.lang.String" charset="ISO-8859-1"/>


此处的更多信息:

我已尝试这样做,但不起作用,我仍然收到错误。您将其放置在路线中的何处?我尝试将其放置在setHeader标记之后。我也试着把它放在from标签后面