Hi, It's seems you are using the JMS component. Did you take a look on camel-wmq one ?
Regards JB On 22/10/2019 18:26, Wang Yan wrote: > Any one has idea how to set IBM Encoding on exchange header ? > I try to set it on IBMMQFactory but does not work therefore I did setting > as below not sure it is correct way or not > > > exchange.getIn().setHeader(WMQConstants.WMQ_ENCODING, 1208); > exchange.getIn().setHeader(WMQConstants.JMS_IBM_MQMD_ENCODING, 1208); > exchange.getIn().setHeader(WMQConstants.JMS_IBM_MQMD_FORMAT, > MQC.MQFMT_STRING); > exchange.getIn().setHeader(WMQConstants.JMS_IBM_FORMAT, MQC.MQFMT_STRING); > > > ---------- Forwarded message --------- > From: W.Y [via Camel] <ml+s465427n5845743...@n5.nabble.com> > Date: Sat, Oct 19, 2019 at 6:55 AM > Subject: Fwd: Camel always sending MQRFH2 headers to target WebsphereMQ > queue > To: W.Y <wyan...@gmail.com> > > > @Willem.Jiang [via Camel] <[hidden email] > <http:///user/SendEmail.jtp?type=node&node=5845743&i=0>> > > Thanks for the reply, I am using openJRE11 > > BTW , is the cast exception due to java version? My assumption is it should > be related to IBM libs > according to code, during runtime, the session is expected > as MQQueueSession instance but it is MQSession instance instead . > > MQQueueSession wmqSession = (MQQueueSession) session > > ---------- Forwarded message --------- > From: Willem.Jiang [via Camel] <[hidden email] > <http:///user/SendEmail.jtp?type=node&node=5845743&i=1>> > Date: Sat, Oct 19, 2019 at 3:31 AM > Subject: Re: Camel always sending MQRFH2 headers to target WebsphereMQ > queue > To: W.Y <[hidden email] > <http:///user/SendEmail.jtp?type=node&node=5845743&i=2>> > > > Which version of JDK are you using? > From the stack trace, it looks like you cannot cast the > com.ibm.mq.jms.MQSession to com.ibm.mq.jms.MQQueueSession. > I think you need to check the client code for more information. > > Willem Jiang > > Twitter: willemjiang > Weibo: 姜宁willem > > On Fri, Oct 18, 2019 at 11:51 PM Wang Yan <[hidden email] > <http:///user/SendEmail.jtp?type=node&node=5845741&i=0>> wrote: > >> >> I have problem , camel is always sending MQRFH2 headers to target >> WebsphereMQ queue >> >> I used below code try to solve the problem but i got >> Setup of JMS message listener invoker failed for destination >> >> - trying to recover. Cause: class com.ibm.mq.jms.MQSession cannot be cast >> to class com.ibm.mq.jms.MQQueueSession (com.ibm.mq.jms.MQSession and >> com.ibm.mq.jms.MQQueueSession are in unnamed module of loader >> org.springframework.boot.loader.LaunchedURLClassLoader @5056dfcb) >> >> >> IBM library i used is >> // https://mvnrepository.com/artifact/com.ibm.mq/com.ibm.mq.allclient >> implementation 'com.ibm.mq:com.ibm.mq.allclient:9.1.1.0' >> >> What could be the problem? Did I used to wrong libs? any suggestions or >> feedback are more than welcome! >> >> >> JmsComponent wmq = new JmsComponent(connectionFactory); >> wmq.setDestinationResolver(new DestinationResolver() { public Destination >> resolveDestinationName(Session session, String destinationName, boolean >> pubSubDomain) throws JMSException { MQQueueSession wmqSession = >> (MQQueueSession) session; return wmqSession.createQueue("queue:///" + >> destinationName + "?targetClient=1"); } }); > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > https://camel.465427.n5.nabble.com/Camel-always-sending-MQRFH2-headers-to-target-WebsphereMQ-queue-tp5845716p5845741.html > To unsubscribe from Camel always sending MQRFH2 headers to target > WebsphereMQ queue, click here > < > https://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5845716&code=d3lhbmJveEBnbWFpbC5jb218NTg0NTcxNnwxMTU1MzAzODM=> > > . > NAML > < > https://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > https://camel.465427.n5.nabble.com/Camel-always-sending-MQRFH2-headers-to-target-WebsphereMQ-queue-tp5845716p5845743.html > To unsubscribe from Camel always sending MQRFH2 headers to target > WebsphereMQ queue, click here > <https://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5845716&code=d3lhbmJveEBnbWFpbC5jb218NTg0NTcxNnwxMTU1MzAzODM=> > . > NAML > <https://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com