title: Camel JMS object message payload converts from object to byte message while using Websphere MQ
body: <p>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.  <br>
  I am using JNDI connection for websphere MQ in JBOSS 5.0 GA environment. </p>
  
  <pre>
  &lt;tx-connection-factory&gt;<br>
      &lt;jndi-name&gt;MQConnFactory
      &lt;xa-transaction /&gt;<br>
      &lt;rar-name>wmq.jmsra.rar
      &lt;connection-definition&gt;javax.jms.ConnectionFactory&lt;/connection-definition&gt;<br>
      &lt;
      &lt;config-property name="channel" type="java.lang.String"&gt;xxxx&lt;/config-property&gt;<br>
      &lt;config-property name="hostName" type="java.lang.String"&gt;xxxxx&lt;/config-property&gt;<br>
      &lt;config-property name="port" type="java.lang.String"&gt;xxxx&lt;/config-property&gt;<br>
      &lt;config-property name="username" type="java.lang.String"&gt;xxxxx&lt;/config-property&gt;<br>
      &lt;config-property name="password" type="java.lang.String"&gt;xxxx&lt;/config-property&gt;<br>
      &lt;config-property name="queueManager" type="java.lang.String"&gt;xxxxxx&lt;/config-property&gt;<br>
      &lt;config-property name="transportType" type="java.lang.Integer"&gt;CLIENT&lt;/config-property&gt;<br>
      &lt;security-domain-and-application&gt;JmsXARealm&lt;/security-domain-and-application&gt;<br>
      &lt;min-pool-size&gt;1
      &lt;max-pool-size&gt;60
      &lt;idle-timeout-minutes&gt;10
      &lt;blocking-timeout-millis&gt;5000
    &lt;/tx-connection-factory&gt;<br>
  </pre>
  
  <p><br>
  We faced someother problem with IBM  attributes which were resolved by removing the attributes. Also we have camel header attribute to set the message
  <br>
  <pre>
  &lt;route id="myrouteName"&gt; <br>
          &lt;from uri="direct:myrouteName"&gt;&lt;/from&gt; <br>
          &lt;setHeader headerName="prequest"&gt;<br>
              &lt;simple&gt;${body[0]}&lt;/simple&gt;<br>
          &lt;/setHeader&gt;<br>
          &lt;doTry&gt;<br>
              &lt;to uri="bean:myWrapService?method=mymethod" /&gt;<br>
              &lt;filter&gt;<br>          &lt;simple&gt;${body.reqVO} != null&lt;/simple&gt;<br>
                  &lt;setHeader headerName="CamelJmsMessageType"&gt; &lt;constant&gt;Object&lt;/constant&gt;&lt;/setHeader&gt;<br>
                          &lt;to uri="{{requestQ}}" pattern="InOnly" /&gt;<br>
              &lt;/filter&gt;<br>
              &lt;to uri="direct:responseHandler" /&gt;<br>
              &lt;to uri="bean:responseService?method=myMethod"/&gt;<br>
              &lt;doCatch&gt;<br>
                  &lt;exception&gt;java.lang.Exception&lt;/exception&gt;<br>
                  &lt;to uri="bean:exceptionHandler?method=process" /&gt;<br>
                  &lt;to uri="bean:responseService?method=myMethod" /&gt;<br>
              &lt;/doCatch&gt;<br>
          &lt;/doTry&gt;<br>
      &lt;/route&gt;<br>
  </pre><br>
  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.
  <br>
  <pre><br>
  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&amp;encoding=1&amp;targetClient=1 with message: <br>
    JMSMessage class: jms_object<br>
    JMSType:          null<br>
    JMSDeliveryMode:  1<br>
    JMSExpiration:    0<br>
    JMSPriority:      0<br>
    JMSMessageID:     null<br>
    JMSTimestamp:     0<br>
    JMSCorrelationID: null<br>
    JMSDestination:   null<br>
    JMSReplyTo:       null<br>
    JMSRedelivered:   false<br>
      CamelJmsDeliveryMode: 1<br>
      CamelJmsMessageType: Object<br>
      JMS_IBM_Character_Set: IBM437<br>
      JMS_IBM_Encoding: 273<br>
      JMS_IBM_Format:       <br><br>
      JMS_IBM_MsgType: 8<br>
      JMS_IBM_PutApplType: 28<br>
      JMS_IBM_PutDate: 20140910<br>
      JMS_IBM_PutTime: 15475401<br>
      breadcrumbId: ID-INN58JT4BS-53364-1410346638012-2-8<br>
      operationName: pay<br>
      operationNamespace: http:/www.xxx.com/xxxxx/xxxxx/<br>
  class com.xxx.xxxx.xxx.vo.PayloadDTO<br></p>
  
  <p>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]<br>
  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 &lt;&lt;&lt; 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=<em>/</em>, org.apache.cxf.headers.Header.list=[], org.apache.cxf.message.Message.BASE_PATH=cwmq://queue:jmsReqQueue?jmsMessageType=Bytes&amp;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&amp;replyTo=jmsRespQueue?wsdl, JMS_IBM_Encoding=273, Content-Type=<em>/</em>, 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=<a href="http://www.xxx.xxx/xxx/xxx=xxxx" rel="nofollow">http://www.xxx.xxx/xxx/xxx=xxxx</a>, 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&amp;exchangePattern=InOnly&amp;jmsMessageType=Object&amp;maxConcurrentConsumers=10&amp;maxMessagesPerTask=2] consumer received JMS message: <br>
    JMSMessage class: jms_bytes<br>
    JMSType:          null<br>
    JMSDeliveryMode:  2<br>
    JMSExpiration:    0<br>
    JMSPriority:      4<br>
    JMSMessageID:     ID:414d5120484b49424b31533120202020318cf553051a5420<br>
    JMSTimestamp:     1410364124990<br>
    JMSCorrelationID: null<br>
    JMSDestination:   null<br>
    JMSReplyTo:       null<br>
    JMSRedelivered:   false<br>
      JMSXAppID: WebSphere MQ Client for Java<br>
      JMSXDeliveryCount: 1<br>
      JMSXUserID: ibnkmq      <br>
      JMS_IBM_Character_Set: IBM437<br>
      JMS_IBM_Encoding: 273<br>
      JMS_IBM_Format:         <br>
      JMS_IBM_MsgType: 8<br>
      JMS_IBM_PutApplType: 28<br>
      JMS_IBM_PutDate: 20140910<br>
      JMS_IBM_PutTime: 15484499<br>
  aced000573720023636f6d2e7363622e6368616e6e656c732e626173652e766f2e5061796c6f6164<br>
  44544f163e357ea7d7ff690200044c000c63757272656e7453746174657400124c6a6176612f6c61<br>
  6e672f537472696e673b4c000972657175657374564f7400214c636f6d2f7363622f6368616e6e65<br>
  6c732f626173652f766f2f42617365564f3b4c000a726573706f6e7365564f71007e00024c000974<br>
  72616365506174687400104c6a6176612f7574696c2f4c6973743b7870707372002b636f6d2e7363<br>
  622e6368616e6e656c732e626173652e766f2e42696c6c657250617952657175657374564f6aa292<br>
  32aa1e2e1f0200034c00106163636f756e74496e7175697279564f74002b4c636f6d2f7363622f63<br>
  68616e6e656c732f626173652f766f2f4163636f756e74496e7175697279564f3b4c001562696c6c<br>
  506179526567697374726174696f6e564f7400304c636f6d2f7363622f6368616e6e656c732f6261<br>
  73652f766f2f42696c6c506179526567697374726174696f6e564f3b4c001262696c6c6572506179<br>
  ...<br>
  </pre><br></p>