Hi souciane,

I am posting message to websphere queue with all the headers set to camel
message but this message is not published to MQ. However, when I try to
publish it with a standalone applciation, the message is published. Please
find sample code below.

message.setHeader("provider-uri", providerUri);
message.setHeader(JmsConstants.JMS_IBM_MQMD_APPLIDENTITYDATA,
                                                               
appIdententyData());
message.setHeader(JmsConstants.JMS_IBM_MQMD_MSGID, createMsgId());
message.setHeader(JmsConstants.JMS_IBM_MQMD_PERSISTENCE,
                                                               
MQC.MQPER_NOT_PERSISTENT);
MQMessage mqMessage = new MQMessage();
mqMessage.write(byte[])
message.setBody(mqMessage);

if (camelContext.getComponent(connName) == null) {     
              camelContext.addComponent(connName, JmsComponent                  
                                                             
.jmsComponent(createWMQConnection(wmqHost, mqPort,                              
                                                                                
 
queueMngr, channel)));
 
                                }


                private UserCredentialsConnectionFactoryAdapter
createWMQConnection(
                                                String host, int port,
String queueMngr, String channel)
                                                throws JMSException {
 
                                MQEnvironment.CCSID = 943;
                                MQEnvironment.channel = channel;
                                MQEnvironment.hostname = host;
                                MQEnvironment.port = port;
 
                                MQPutMessageOptions pmo = new
MQPutMessageOptions();
 
                                pmo.options = MQC.MQPMO_FAIL_IF_QUIESCING
                                                                +
MQC.MQPMO_SET_IDENTITY_CONTEXT;
 
                                JmsFactoryFactory ff = JmsFactoryFactory
                                                               
.getInstance("com.ibm.msg.client.wmq");
                                JmsConnectionFactory cf =
ff.createConnectionFactory();
                                // Set the properties
                                cf.setStringProperty("XMSC_WMQ_HOST_NAME",
host);
                                cf.setIntProperty("XMSC_WMQ_PORT", port);
                                cf.setStringProperty("XMSC_WMQ_CHANNEL",
channel);
                                cf.setBooleanProperty("Use MQCSP
authentication", true);
                               
cf.setIntProperty("XMSC_WMQ_CONNECTION_MODE", 1);
                               
cf.setStringProperty("XMSC_WMQ_QUEUE_MANAGER", queueMngr);
 
                                ucf = new
UserCredentialsConnectionFactoryAdapter();
                                ucf.setTargetConnectionFactory(cf);
                                ucf.setUsername("JTB0001");
                                ucf.setPassword("1BOI6F4Ztgkd4X6EDNaQ9");
                                return ucf;
                }







--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-WebSphere-MQ-Integration-tp5787731p5787741.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to