Spring JMS + WebSphere MQ client - ibm-mq

I was trying to configure jms template to connect to WebSphere MQ. When using Websphere client jar, there are multiple options that were set like MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING etc for Queue's and PUT and GET options like MQC.MQPMO_NEW_MSG_ID , MQC.MQGMO_WAIT, MQC.MQMO_MATCH_CORREL_ID etc.,.,
is there way to pass these option to JMS template ?

These options are IBM MQ specific, so don't think they can be passed as it is to Spring. But some of these have a JMS equivalent available in Spring template.
MQC.MQOO_OUTPUT option means open queue for putting messages and is equivalent to JMS createProducer API.
MQC.MQGMO_WAIT option is equivalent to receive(timeout)
MQC.MQMO_MATCH_CORREL_ID - is equivalent to creating a consumer with a selector "JMSCorrelatoinID=<your correlationid>"

Related

Is it possible to create a common JMS listener for both IBM MQ and ActiveMQ Artemis?

I have created a Maven module with all configuration for ActiveMQ Artemis. I have done the same for IBM MQ.
I am building two separate jars for above modules.
Now I have added both jars to the classpath of my microservice.
I am struggling to find a way to load one of the above jar file based on some configuration such as active.broker = artemis or ibm mq.
Given that both ActiveMQ Artemis and IBM MQ provide JMS client implementations it should be relatively straight-forward to use the same JMS application with either.
Both ActiveMQ Artemis and IBM MQ JMS clients include JNDI implementations which can be used to "lookup" their respective admin objects (e.g. connection factories & destinations) in a standard way. You only need to swap the InitialContext configuration parameters when using ActiveMQ Artemis vs. IBM MQ.

Integration Wildfly appication server and Websphere MQ

I need to integrate Wildfly and Websphere MQ it means that I want send JMS message from Wildfly to Websphere MQ.
What is the best way to achieve this? Should I implement some client and sent these JMS messages directly or maybe there is similar method like JMS bridge?

Build a standalone JMS client using JAVA

I am new to JMS and I need to build a generic JMS client to create a connection send and receive message by using queues and topics. I have seen many example using activeMQ connection factory, but I need a generic client which can use any connection factory and create a connection. Any leads or sample codes will be useful.
I have just done that recently. Steps I've taken
Read Java JMS tutorials to understand what is JMS.
You can code in Java or use a framework for example - Spring JMS
Read about MQ provider docs. for example activeMQ or IBM MQ.

How to list all JMS providers including Default MQ messaging provider with particular scope

I have a wsadmin command to get list of JMS providers for all scope level
AdminJMS.listJMSProviders()
The above code is going to have the below output
['"WebSphere MQ JMS Provider(cells/redhatserverNode01Cell/nodes/redhatserverNode01/servers/server1|resources.xml#builtin_mqprovider)"',
'"WebSphere MQ JMS Provider(cells/redhatserverNode01Cell/nodes/redhatserverNode01|resources.xml#builtin_mqprovider)"',
'"WebSphere MQ JMS Provider(cells/redhatserverNode01Cell|resources.xml#builtin_mqprovider)"',
'sample(cells/redhatserverNode01Cell/nodes/redhatserverNode01/servers/server1|resources.xml#JMSProvider_1487316020150)']
what my question is
How to get JMS providers for particular scope
The above output displays all provider except default MQ messaging provider, how to get Default MQ messaging provider as well
I can't help you with displaying the default JMS provider, but you can use AdminConfig.list to filter by scope,
wsadmin>print AdminConfig.list('JMSProvider', '*cells/myCell/nodes/myNode/servers/server1*')
"WebSphere MQ JMS Provider(cells/myCell/nodes/myNode/servers/server1|resources.xml#builtin_mqprovider)"
wsadmin>print AdminConfig.list('JMSProvider', '*cells/myCell/nodes/myNode|*')
"WebSphere MQ JMS Provider(cells/myCell/nodes/myNode|resources.xml#builtin_mqprovider)"
wsadmin>print AdminConfig.list('JMSProvider', '*cells/myCell|*')
"WebSphere MQ JMS Provider(cells/myCell|resources.xml#builtin_mqprovider)"

Trying to use jms publisher/subscriber in jmeter to connect to IBM MQ

We have been using jms point-to-point sampler in jmeter to post an xml based request to the MQ. Since then our application has changed and now the messages that are posted to the MQ are Serialable objects created with spring integration. To have a test around this, we tried using jms publisher/subscriber. All the online support we tried is pointing to connection to ActiveMQ. Has anyone tried using jms published to post object message to and IBM MQ?
The online approach gives you all the elements to switch to IBM MQ.
You would need to:
put IBM MQ jars in lib folder of jmeter
Find the infos needed for :
http://jmeter.apache.org/usermanual/component_reference.html#JMS_Subscriber
http://jmeter.apache.org/usermanual/component_reference.html#JMS_Publisher
This will help you:
http://leakfromjavaheap.blogspot.com/2014/07/jmeter-and-websphere-mq-series.html?_sm_au_=iVV5P5vR626sDt7V

Resources