to view all websphere MQ messages in JMS call - jms

I use JMS (Java Message Service API) in my java application to work with queues/topics residing on websphere MQ. I am looking for a tool/support pac which can show me all MQ Messages being called e.g. when I do queueConnectionFactory.createConnection(), it would have resulted into MQCONN/MQCONNX call, so I need to see what excatly is being passed. So basically during my entire JMS based interaction, I want to see all MQ messages which are being passed to. Is it possible?

if you are using websphere, you can turn on tracing by going to WAS console and tracing service to enable jms logging.

Trace tells you what APIs are being called. To a good extent trace helps. But beyond that call IBM help.

If you are using JMS MQ client mode connection it is possible to run send/receive exits on the MQ SVRCONN channel to log the client MQI and message flows. The free IBM SupportPac MA0Z has this capability. This technique is not possible with a binding mode connection because there is no MQ channel involved.

Related

How to send MQ messages (JMS) using JMeter

I have to put messages in a queue for which I have all the connection details (host, port, channel, manager, queuename and username). I never worked on implementing JMeter for sending MQ. Can anyone let me know where can I get (blog or reference) step by step procedure to perform this? I tried referring to official site, can't really understand those JNDI, connection Factory settings
Man, your MQ statement is too general as there are too many possible message queue system providers like Apache ActiveMQ, RabbitMQ, IBM MQ, TIBCO, etc. and the values for all these JNDI/JMS properties, connection factory names, queue names, etc. will be different.
To get an overview of Java communication with "MQ" get familiarized with Getting Started with Java Message Service (JMS)
Download .jar files for your MQ system and put them to JMeter Classpath
Perform configuration as per your MQ system connection settings, example setup for Apache ActiveMQ is here: Building a JMS Testing Plan - Apache JMeter

Websphere MQ Server-To-Server-Connection with Apache ActiveMQ possible?

Does Apache Active MQ provide Server-To-Server-Connection as IBM Websphere MQ does?
Background:
We currently have Websphere MQ 7.0.1 (CUST) installed to communicate with another remote Websphere MQ Server (GOV), which is not under our control.
The MQs hold a Server-To-Server-Connection via VPN-tunnel. We would like to replace our Websphere MQ with Apache ActiveMQ.
We have one QM-Manager with 4 queues and 3 channels.
Queues:
OUT (type remote): for sending messages to GOV
QOUT (local type transmission) that is used for OUT
IMP (local): used for receiving from GOV
DLQ: (local): dead letter queue
Channels:
conch: server connection
CUST_GOV: sender
GOV_CUST: receiver
I read a lot about bridging ActiveMQ to Websphere MQ (Client API, Resource Adapter, OSGi) with Camel.
Looks pretty easy with a Camel route, but this is at least a Client-Server setup.
E. G. https://www.shaishavparekh.com/2016/01/wmq-to-amq-bridge/
I need something that hides away the IBM proprietary channel stuff.
Now I found this entry: https://serverfault.com/questions/366743/apache-activemq-server-to-server-connection
As this is from 2012 I would like to ask, if anyone successful switched from Websphere MQ to ActiveMQ resp. is it still true that I can only use Client-Server?
ActiveMQ does not support a server-to-server connection to WebsphereMQ. As you mentioned, Camel would probably be the simplest way to get a connection between the two brokers.
To be clear, even if ActiveMQ did implement a bridge with WebsphereMQ it would almost certainly use the WebsphereMQ client so would fundamentally still be a client-server implementation. It's not really clear from your question why you want to avoid this.

How can I view the JMS message selector a client application is using against a WebSphereMQ Queue Manager

I would like to be able to view the exact JMS message selector SQL that a WebSphere MQ JMS client application is using on its receive call.
If I run the client application against TIBCO EMS as the JMS provider the TIBCO EMS Administration API provides visibility of this information.
When the client application is run against WebSphere MQ as the JMS provider I can use:
display qstatus(MyQUEUE) type(handle) all
to see the consumers of the queue, but I can't see what JMS message selector the client has declared.
Currently it's not possible to see the selector in use; other open options, message information can be seen via runqmsc or via Explorer. (In Explorer, the Applications Connection view can show you what is connected with associated information).
I would suggest that you raise a Request For Enhancement - the process is documented here http://www-01.ibm.com/support/docview.wss?uid=swg21266802
Matthew

Scheduled delivery of messages in IBM MQ

I am using IBM MQ & active mq in my application using Spring jms. I have a requirement to schedule a message for redelivery after x seconds.
I am able to achieve it in Active mq by setting the AMQ_SCHEDULED_DELAY header. This makes the message to get delivered to the queue after a specified number of seconds.
Is there anything similar in IBM MQ that I can use to achieve the above mentioned functionality ?
Any help is appreciated.
Well JMS 1.1 specification does not mention anything about delayed delivery of a message. Hence you don't have that feature in WMQ. Just released JMS 2.0 specification describes this feature.
yeah, WMQ isn't the best JMS impl for that sort of thing. Take a look at apache camel. It can provide this sort of delayed message routing.

How to receive multiple messages from an IBM MQ

I'm connecting to an IBM Websphere MQ and currently reading one message at a time using the method receive() from the object:
javax.jms.Message;
Is there a way to retrieve multiple messages from the queue in one go?
Many thanks,
G.
Depends on whether you make a distinction between "read" and "retrieve".
From a JMS perspective, no. The API will return one message per method call.
From the WMQ perspective, yes - provided the client and queue manager are both at v7 and the messages are non-persistent or being browsed. In this case you can enable read-ahead in the managed object definition or dynamically at run time. The queue manager will stream several messages off of the queue and deliver them to the application before the first one is acknowledged. For more information on this, see Using read ahead with WebSphere MQ classes for JMS.

Resources