Saya menggunakan Apache camel (Fuse 2.10.x) dengan sabun melalui http dan sabun melalui jms. Pesan JMS dikonversi dari pesan Objek ke format pesan Byte yang menyebabkan masalah dalam membaca pesan.
Saya menggunakan koneksi JNDI untuk websphere MQ di lingkungan 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
Jadi dengan menyetel targetClient=1 berarti kode tersebut meminta klien JMS yang mendasarinya untuk mengirim pesan sebagai pesan MQ 'mentah'. Itu tidak akan memiliki properti JMS... hanya header dan payload MQ. Aplikasi apa pun yang menerima pesan tidak akan melihat pesan JMS. Oleh karena itu klien JMS jika melihat pesan tersebut hanya akan dapat membuat pesan bytes.