gpt4 book ai didi

java - Camel : Write Message to WMQ

转载 作者:太空宇宙 更新时间:2023-11-04 14:48:46 25 4
gpt4 key购买 nike

目前我正在使用camel和wmq。我试图做的是向 wmq 发送消息。我使用 Spring 框架配置 Camel 。以下是配置 wmq 的方法:

component.xml

<bean id="websphere-mq" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="transportType">
<util:constant static-field="com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP" />
</property>
<property name="hostName" value="localhost" />
<property name="port" value="1414" />
<property name="queueManager" value="localmanager" />
<property name="channel" value="CH.ADM1" />
<property name="CCSID" value="819"/>
<property name="useConnectionPooling" value="true" />
</bean>
</property>
</bean>

config.xml

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

<route>
<from uri="stream:in?promptMessage=Ausweisnummer: "/>
<process ref="TransformToXML"/>
<to uri ="xslt:mobako.sender.xsl"/>
<to uri ="websphere-mq:queue:LSMH.ZKSEAP.SERVICEBUS"/>
</route>

<route>
<from uri="websphere-mq:queue:ZKSEAP.LSMH.SERVICEBUS"/>
<to uri="stream:out"/>
</route>

</camelContext>

当我检查wmq时,我发现wmq一直在监听我的进程,但没有收到任何消息。

然后为了检查我的 wmq 配置是否正确,我尝试将 config.xml 更改为如下所示:

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

<route>
<from uri="websphere-mq:queue:ZKSEAP.LSMH.SERVICEBUS"/>
<to uri="stream:out"/>
</route>

</camelContext>

之后我尝试将消息手动写入 wmq。当我尝试运行我的进程时,来自 wmq 的消息就会写在我的控制台上。

然后,我总结一下,通过我的配置,我可以从wmq获取消息,但无法写入wmq。

问题到底是什么?我的配置是否有问题或缺失?非常感谢。

已编辑

嘿嘿,终于知道出了什么问题了。问题是:我的 jms 版本与我的camel 版本不一样。但是,在我更改 jms 版本后,我的服务器上出现以下错误(关于 wmq):

2014-06-05 15:14:34,859 [Axis2 Task] ERROR WMQMsg - Expected MQ message format ' MQSTR ', but received 'MQHRF2 '

如何解决?再次感谢。

最佳答案

关于java - Camel : Write Message to WMQ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24057475/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com