ฉันใช้ apache Camel (Fuse 2.10.x) กับ Soap บน http และ Soap บน jms ข้อความ JMS จะถูกแปลงจากข้อความ Object เป็นรูปแบบข้อความ Byte ซึ่งทำให้เกิดปัญหาในการอ่านข้อความ
ฉันกำลังใช้การเชื่อมต่อ JNDI สำหรับ websphere MQ ในสภาพแวดล้อม JBOSS 5.0 GA
<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>
We faced someother problem with IBM attributes which were resolved by removing the attributes. Also we have camel header attribute to set the message
<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>
This works fine with soap over http. RequestQ get messages as JMS object message. But same RequestQ get message by JMS Byte Message in soap over JMS. Suggest me approach which I can ensure that message recieved as Object message in all scenario. Note: Same scenario works fine with activeMQ as JMS provider. Other Tech Stack: Spring 3.x, hibernate, apache cxf and etc.
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
ดังนั้นโดยการตั้งค่า targetClient=1 หมายความว่าโค้ดกำลังขอให้ไคลเอ็นต์ JMS พื้นฐานส่งข้อความเป็นข้อความ MQ 'ดิบ' มันจะไม่มีคุณสมบัติ JMS ใดๆ... แค่ส่วนหัว MQ และเพย์โหลด แอปพลิเคชันใดๆ ที่ได้รับข้อความจะไม่เห็นข้อความ JMS ดังนั้นไคลเอ็นต์ JMS หากเห็นข้อความจะสามารถสร้างข้อความไบต์ได้เท่านั้น