You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "sari.reach" <sa...@gmail.com> on 2016/09/19 17:44:05 UTC
Camel- WebSphere MQ Integration
Messages subscribed to Websphere MQ using camel for a plain text messages are
subscribed but
when headers are set to camel message and posted. These messages are not
being subscribed to websphere MQ however these are subscribed with a
standalone application.
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-WebSphere-MQ-Integration-tp5787731.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel- WebSphere MQ Integration
Posted by "sari.reach" <sa...@gmail.com>.
Sent from my iPhone
> On 20-Sep-2016, at 11:31 AM, sari.reach [via Camel] <ml...@n5.nabble.com> wrote:
>
> 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;
> }
>
>
>
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://camel.465427.n5.nabble.com/Camel-WebSphere-MQ-Integration-tp5787731p5787741.html
> To start a new topic under Camel - Users, email ml-node+s465427n465428h73@n5.nabble.com
> To unsubscribe from Camel - Users, click here.
> NAML
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-WebSphere-MQ-Integration-tp5787731p5787745.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel- WebSphere MQ Integration
Posted by "sari.reach" <sa...@gmail.com>.
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.
Re: Camel- WebSphere MQ Integration
Posted by souciance <so...@gmail.com>.
Can you please explain your problem in step by step and preferably with
some code and logs?
On Mon, Sep 19, 2016 at 7:45 PM, sari.reach [via Camel] <
ml-node+s465427n5787732h55@n5.nabble.com> wrote:
>
>
> On Mon, Sep 19, 2016 at 11:14 PM, sari.reach [via Camel] <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5787732&i=0>> wrote:
>
>> Messages subscribed to Websphere MQ using camel for a plain text messages
>> are subscribed but
>> when headers are set to camel message and posted. These messages are not
>> being subscribed to websphere MQ however these are subscribed with a
>> standalone application.
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://camel.465427.n5.nabble.com/Camel-WebSphere-MQ-Integra
>> tion-tp5787731.html
>> To start a new topic under Camel - Users, email [hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5787732&i=1>
>> To unsubscribe from Camel - Users, click here.
>> NAML
>> <http://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:
> http://camel.465427.n5.nabble.com/Camel-WebSphere-MQ-
> Integration-tp5787731p5787732.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://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>
>
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-WebSphere-MQ-Integration-tp5787731p5787733.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel- WebSphere MQ Integration
Posted by "sari.reach" <sa...@gmail.com>.
On Mon, Sep 19, 2016 at 11:14 PM, sari.reach [via Camel] <
ml-node+s465427n5787731h66@n5.nabble.com> wrote:
> Messages subscribed to Websphere MQ using camel for a plain text messages
> are subscribed but
> when headers are set to camel message and posted. These messages are not
> being subscribed to websphere MQ however these are subscribed with a
> standalone application.
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Camel-WebSphere-MQ-
> Integration-tp5787731.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h73@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c2FyaS5yZWFjaEBnbWFpbC5jb218NDY1NDI4fDE2ODE4MDY5NDU=>
> .
> NAML
> <http://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>
>
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-WebSphere-MQ-Integration-tp5787731p5787732.html
Sent from the Camel - Users mailing list archive at Nabble.com.