当前位置: 首页 > 知识库问答 >
问题:

在使用Websphere MQ时,Camel JMS对象消息有效负载将从对象消息转换为字节消息

公胤运
2023-03-14

我正在使用apache camel(Fuse 2.10.x)和soap over http和soap over JMS。JMS消息由对象消息转换为字节消息格式,这就造成了消息读取的问题。
我正在JBoss5.0GA环境中使用用于websphere MQ的JNDI连接。

<tx-connection-factory>
<jndi-name>MQConnFactory <xa-transaction />
<rar-name>wmq.jmsra.rar <connection-definition>javax.jms.ConnectionFactory</connection-definition>
< <config-property name="channel" type="java.lang.String">xxxx</config-property>
<config-property name="hostName" type="java.lang.String">xxxxx</config-property>
<config-property name="port" type="java.lang.String">xxxx</config-property>
<config-property name="username" type="java.lang.String">xxxxx</config-property>
<config-property name="password" type="java.lang.String">xxxx</config-property>
<config-property name="queueManager" type="java.lang.String">xxxxxx</config-property>
<config-property name="transportType" type="java.lang.Integer">CLIENT</config-property>
<security-domain-and-application>JmsXARealm</security-domain-and-application>
<min-pool-size>1 <max-pool-size>60 <idle-timeout-minutes>10 <blocking-timeout-millis>5000 </tx-connection-factory>


我们遇到了IBM属性的另一个问题,通过删除属性解决了这个问题。我们还有camel header属性来设置消息

<route id="myrouteName"> 
<from uri="direct:myrouteName"></from>
<setHeader headerName="prequest">
<simple>${body[0]}</simple>
</setHeader>
<doTry>
<to uri="bean:myWrapService?method=mymethod" />
<filter>
<simple>${body.reqVO} != null</simple>
<setHeader headerName="CamelJmsMessageType"> <constant>Object</constant></setHeader>
<to uri="{{requestQ}}" pattern="InOnly" />
</filter>
<to uri="direct:responseHandler" />
<to uri="bean:responseService?method=myMethod"/>
<doCatch>
<exception>java.lang.Exception</exception>
<to uri="bean:exceptionHandler?method=process" />
<to uri="bean:responseService?method=myMethod" />
</doCatch>
</doTry>
</route>

16:33:17,134 INFO [STDOUT] 16:33:17.133 [Camel (csCamelConfig) thread #8 - JmsConsumer[reqQueue]] DEBUG o.a.c.component.jms.JmsConfiguration - Sending JMS message to: queue://XXXXXXXXXX/REQ.QUEUE2?CCSID=819&encoding=1&targetClient=1 with message:
JMSMessage class: jms_object
JMSType: null
JMSDeliveryMode: 1
JMSExpiration: 0
JMSPriority: 0
JMSMessageID: null
JMSTimestamp: 0
JMSCorrelationID: null
JMSDestination: null
JMSReplyTo: null
JMSRedelivered: false
CamelJmsDeliveryMode: 1
CamelJmsMessageType: Object
JMS_IBM_Character_Set: IBM437
JMS_IBM_Encoding: 273
JMS_IBM_Format:

JMS_IBM_MsgType: 8
JMS_IBM_PutApplType: 28
JMS_IBM_PutDate: 20140910
JMS_IBM_PutTime: 15475401
breadcrumbId: ID-INN58JT4BS-53364-1410346638012-2-8
operationName: pay
operationNamespace: http:/www.xxx.com/xxxxx/xxxxx/
class com.xxx.xxxx.xxx.vo.PayloadDTO

共有1个答案

姜松
2023-03-14

因此,通过设置targetClient=1,这意味着代码要求底层JMS客户机将消息作为“原始”MQ消息发送。它将没有任何JMS属性...只是一个MQ头和有效负载。任何获取消息的应用程序都不会看到JMS消息。因此,如果JMS客户机看到该消息,它将只能创建一个字节消息。

这个targetclient配置在哪里?我在上面的配置中没有看到。

 类似资料:
  • 我已经应用了一个使用snmp4j发送和接收陷阱的示例,一切都很好。 但问题是: 当使用mule esb接收snmp陷阱时,我无法将传入的消息有效负载转换为PDU(或任何snmp4j合适的对象)以从中提取数据,我已经做了很多搜索,但徒劳无功。 有人能帮助我: 将我从udpendpoint收到的mule esb消息有效负载转换为org.snmp4j。从PDU对象中提取陷阱数据吗? 这是我的代码:

  • 我想填充Javapojo类与mqtt消息有效载荷在一个Springmvc应用程序。我的代码是: MQTT MessagePayload是{“name”:“abc”,“age”:32},但当它在变量MessagePayload中转换为字符串时,它显示为类似{name:abc,age:32}。你看,去掉所有的双引号。当转到try块时,会抛出一个错误com。fasterxml。杰克逊。果心JsonPar

  • 我创建了RabbitListener来从RabbitMQ队列获取消息。 我的rabbitMQ消息: 不幸的是,在从Message转换为Transfer Transfer Object时引发了异常。 整个消息日志:https://pastebin.com/raw/47lq7dyd

  • 我有一个 X509CertificateObject,一个匹配的 RSAPublicKey,并设法创建一个字节数组,其中包含某个消息对象的有效数字证书,也作为字节数组。 不幸的是,我正在构建的系统只接受对象作为输入。如何将我的基本构建块转换为这样一个有效的 对象? 背景:根据这个示例(摘要是SHA512),我正在试用Java Bouncy Castle RSA盲签名,需要将结果输入到标准签名处理中

  • 我正在尝试使用亚马逊SNS控制台中的发布endpoint将推送通知(PN)从我的应用服务器发送到android设备,该消息和消息结构为json,工作正常。 但是,当我试图实现相同的Java它的设备没有收到通知。 控制台上的响应 发布列表请求:{ target arn:arn:AWS:SNS:AP-south-1:818862955266:endpoint/GCM/Test app/a1ec 811

  • 我正在尝试将单个输入消息转换为多个消息。我有一个带有以下签名的方法: 类类似于: 对于中的每个,我想创建一个的实例。我如何做到这一点并处理