2
votes

I am using apache camel (Fuse 2.10.x) with soap over http and soap over jms. JMS message gets converted from Object message to Byte message format which causes the problem in reading the message.
I am using JNDI connection for websphere MQ in JBOSS 5.0 GA environment.

<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

16:33:19,465 INFO [STDOUT] 16:33:19.465 [Camel (csCamelConfig) thread #8 - JmsConsumer[paymJmsReqQueue]] DEBUG o.a.camel.processor.SendProcessor - >>>> Endpoint[direct://responseHandler] Exchange[Message: com.xxx.xxxx.base.vo.PayloadDTO@e486e6]
16:33:19,466 INFO [STDOUT] 16:33:19.466 [Camel (csCamelConfig) thread #8 - JmsConsumer[paymJmsReqQueue]] INFO o.a.c.processor.interceptor.Tracer - ID-INN58JT4BS-53364-1410346638012-2-10 >>> (responseHandler) direct://responseHandler --> bean://responseProcessor?method=process <<< Pattern:InOut, Headers:{CamelCxfMessage={javax.xml.ws.wsdl.port={http:/impl.xxxx.xxxx.xxx.com/}ServiceImplPort, JMSCorrelationID=null, JMSMessageID=ID:414d5120484b49424b31533120202020318cf553bd565320, org.apache.cxf.service.model.MessageInfo=[MessageInfo INPUT: {http:/www.xxx.com/xxxxx/xxxx/}xxxx], JMSDeliveryMode=1, org.apache.cxf.message.Message.PROTOCOL_HEADERS={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], JMSDeliveryMode=[1], JMSExpiration=[0], JMSMessageID=[ID:414d5120484b49424b31533120202020318cf553bd565320], JMSPriority=[0], JMSRedelivered=[false], JMSTimestamp=[1410364074010], JMSXAppID=[Websphere MQ Client for Java], JMSXDeliveryCount=[1], JMSXUserID=[root ]}, JMSXUserID=root , org.apache.cxf.interceptor.LoggingMessage.ID=2, JMS_IBM_MsgType=8, JMSReplyTo=null, JMSTimestamp=1410364074010, JMSDestination=null, JMSType=null, JMSXDeliveryCount=1, JMSRedelivered=false, javax.xml.ws.wsdl.interface={http:/www.xxx.xxx/xxxxx/xxxx/}xxxx, org.apache.cxf.request.uri=null, HTTP.REQUEST=null, Accept=/, org.apache.cxf.headers.Header.list=[], org.apache.cxf.message.Message.BASE_PATH=cwmq://queue:jmsReqQueue?jmsMessageType=Bytes&replyTo=msRespQueue, org.apache.cxf.message.Message.PATH_INFO=null, JMS_IBM_Format= , org.apache.camel.exchange=Exchange[JmsMessage[JmsMessageID: ID:414d5120484b49424b31533120202020318cf553bd565320]], JMSExpiration=0, JMSPriority=0, javax.xml.ws.wsdl.service={http:/impl.xxx.xxx.xxx.xx/}ServiceImplService, JMS_IBM_PutApplType=28, JMS_IBM_PutDate=20140910, org.apache.cxf.binding.soap.SoapVersion=org.apache.cxf.binding.soap.Soap11@ab8a96, JMS_IBM_PutTime=15475401, org.apache.cxf.message.Message.ENCODING=null, org.apache.cxf.message.Message.QUERY_STRING=null, JMSXGroupID=null, JMS_IBM_Character_Set=IBM437, HTTP.RESPONSE=null, org.apache.cxf.request.method=null, javax.xml.ws.wsdl.operation={http:/www.xxx.xxx/xxxx/xxxxx/}xxxxx, org.apache.cxf.transport.Destination=org.apache.camel.component.cxf.transport.CamelDestination@17a840, javax.xml.ws.wsdl.description=camel://cwmq:queue:jmsReqQueue?jmsMessageType=Bytes&replyTo=jmsRespQueue?wsdl, JMS_IBM_Encoding=273, Content-Type=/, JMSXAppID=Websphere MQ Client for Java}, JMSXUserID=root , breadcrumbId=ID-INN58JT4BS-53364-1410346638012-2-8, JMS_IBM_Character_Set=IBM437, JMSExpiration=0, JMSXDeliveryCount=1, JMSXAppID=Websphere MQ Client for Java, JMS_IBM_Format= , prequest=com.xxx.xxxx.xxxxx.PRequest@93899f, JMSTimestamp=1410364074010, JMS_IBM_PutApplType=28, org.apache.cxf.headers.Header.list=[], JMSDeliveryMode=1, JMS_IBM_PutDate=20140910, JMSPriority=0, JMSRedelivered=false, JMS_IBM_Encoding=273, operationNamespace=http://www.xxx.xxx/xxx/xxx=xxxx, CamelJmsMessageType=Object, JMS_IBM_PutTime=15475401, JMSMessageID=ID:414d5120484b49424b31533120202020318cf553bd565320, JMS_IBM_MsgType=8}, BodyType:com.xxx.xxxxx.base.vo.PayloadDTO, Body:com.xxx.xxxx.base.vo.PayloadDTO@e486e6 16:33:19,466 INFO [STDOUT] 16:33:19.466 [Camel (csCamelConfig) thread #8 - JmsConsumer[paymJmsReqQueue]] DEBUG o.a.camel.processor.SendProcessor - >>>> Endpoint[bean://responseProcessor?method=process] Exchange[Message: com.scb.channels.base.vo.PayloadDTO@e486e6] JmsConsumer[reqQueue]] DEBUG o.a.c.c.jms.EndpointMessageListener - Endpoint[pwmq://queue:reqQueue?concurrentConsumers=2&exchangePattern=InOnly&jmsMessageType=Object&maxConcurrentConsumers=10&maxMessagesPerTask=2] consumer received JMS message:
JMSMessage class: jms_bytes
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 4
JMSMessageID: ID:414d5120484b49424b31533120202020318cf553051a5420
JMSTimestamp: 1410364124990
JMSCorrelationID: null
JMSDestination: null
JMSReplyTo: null
JMSRedelivered: false
JMSXAppID: WebSphere MQ Client for Java
JMSXDeliveryCount: 1
JMSXUserID: ibnkmq
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: 15484499
aced000573720023636f6d2e7363622e6368616e6e656c732e626173652e766f2e5061796c6f6164
44544f163e357ea7d7ff690200044c000c63757272656e7453746174657400124c6a6176612f6c61
6e672f537472696e673b4c000972657175657374564f7400214c636f6d2f7363622f6368616e6e65
6c732f626173652f766f2f42617365564f3b4c000a726573706f6e7365564f71007e00024c000974
72616365506174687400104c6a6176612f7574696c2f4c6973743b7870707372002b636f6d2e7363
622e6368616e6e656c732e626173652e766f2e42696c6c657250617952657175657374564f6aa292
32aa1e2e1f0200034c00106163636f756e74496e7175697279564f74002b4c636f6d2f7363622f63
68616e6e656c732f626173652f766f2f4163636f756e74496e7175697279564f3b4c001562696c6c
506179526567697374726174696f6e564f7400304c636f6d2f7363622f6368616e6e656c732f6261
73652f766f2f42696c6c506179526567697374726174696f6e564f3b4c001262696c6c6572506179
...


1
Can you explain in more details how the message is being sent? MQ JMS doesn't do JMS object type conversion so all things being equal the message if it went in as an object messages should come out as one.Calanais
I am posting Soap message over JMS (webservice) using MQ client. Message is sent as datagram. CXF Endpoint is defined in Camel. CXF gives us marshalled object which gets converted into our own domain universal data object (aka Payload). Then universal data object is dropped in MQ which is processed by another set of domain application.Balakumar Narayanasamy
Managed to resolve problem by removing the targetClient=1 attribute. It is strange but solution worksBalakumar Narayanasamy

1 Answers

2
votes

So by setting targetClient=1 it means the code is asking the underlying JMS client to send the message as a 'raw' MQ message. It won't have any JMS properties... just a MQ header and payload. Any application getting the message won't see a JMS message. Therefore the JMS client if it sees the message will only be able to create a bytes message.

Whereabouts was this targetclient configured? I don't see in the config above.