how to log WebSphere MQ messages - ibm-mq

I have a websphere-mq client and two service that send message to this mq client so
how can i log every message to database that sent and received to websphere mq client?
websphere-mq version: 7.5.0.7

Related

Unable to send message to IBM MQ

We are facing strange problem in our application. We are having three applications, say application A, application B and application C. Application A is a J2EE application deployed in JBoss EAP 7.2.0 which sends a message to ActiveMQ Artemis queue created in the same JBoss server. Application B is a middle-ware application written using Apache Camel which reads the message (which application A sent) from ActiveMQ Artemis queue, does some transformation and sends to a IBM MQ from which application C reads the message.
My issue is when the message is sent by Application A,the message is getting transformed correctly in application B but not sent to the IBM MQ, but when I am sending the same message to ActiveMQ Artemis queue (to which application A sends) using a demo client from my local environment, it is transformed and sent to IBM MQ and application C also picks that up successfully.
Can anyone give some idea why the message is not sent to IBM MQ when sent from application A? Is there some header which can prevent the message to be sent? Thanks in advance.

How to automatically read/receive message from solace queue when application started?

I want to automatically read/receive messages from solace queue/topic if any message produced or published when my application is up. So is there any method in solace which can open connection automatically if there is any message available in Queue/Topic.
So is there any method in solace which can open connection automatically if there is any message available in Queue/Topic
This is not possible for JMS.
JMS applications initiate a connection to the broker and receive messages over the locally initiated connection.
The only way to do what you want is to use REST instead of JMS.
When a REST consumer is configured, the Solace event broker will initiate a HTTP connection to the application.
A sample can be found here:
https://solace.com/samples/solace-samples-rest-messaging/publish-subscribe/

Does ActiveMQ Artemis / RedHat AMQ not set JMS Message ID correctly?

According to the JMS spec, I do not have to specify the message ID when sending.
When I send a message via JMSProducer#send() or when I create a message via the hawt.io console, I can see the message ID being set to some internal sequential number generated by the Artemis broker.
However, when I use MessageConsumer#receive() or MessageListener#onMessage() to receive a Message, Message#getJMSMessageID() always returns null.
The only way I can receive a message with a non-null JMS message ID is by reading a message from a different (IBM) message queue and copying all its properties to the Artemis message before sending it.
I have tested this with both AMQ 7.3.0.GA and Apache ActiveMQ Artemis 2.6.2, with both native (org.apache.activemq.artemis-jms-client) and AMQP (org.apache.qpid.qpid-jms-client) clients.
Is there some configuration I must set on the broker to make it populate JMS message IDs correctly?
JMS Message ID is usually stored in a native Artemis header that is called userID
Messages sent via the management console do not populate userID
Messages sent via the Core JMS client do populate the message ID
Messages sent via the Qpid client populate a custom property NATIVE_MESSAGE_ID with the JMS message ID
There's no way to obtain the internal message ID via JMS
If you send a message via Qpid and read it via Core client or vice versa you will receive a null JMS message ID

IBM Websphere MQ Server

I am trying to create a MQ Server in Websphere Version 8 from IBM Rational Software Architecture. After navigating from Servers->ServerType->Websphere MQ Servers and clicking New button, gave the following fields for mandatory items
Name : stackMQServer
Websphere MQ Server Name : stackMQServer
Server TYPE : Queue Manager
Websphere MQ Host : localhost/1272.0.0.1
Websphere MQ Port : 1414 default
Websphere MQ Channel : SYSTEM.DEF.SVRCONN
Error :
WebSphere MQ server stackMQServer connection test failed for WebSphere MQ queue manager stackMQServer. CWSJP0050E: An attempt to connect to WebSphere MQ queue manager or queue sharing group stackMQServer failed. The WebSphere MQ reason code is MQRC_Q_MGR_NOT_AVAILABLE (2059)..

Target client option in setting up a queue on WAS

In WAS console, on the Queues page, there is an option called 'Target Client' and the options are MQ and JMS. Now MQ i understand is websphere MQ, but what is JMS? Any JMS provider other than Websphere MQ? Because in my case the target is actually websphere MQ but i have selected JMS here and it still works fine.
Target client defines how the message will intepreted by the receiving application.
If you choose MQ, then a RFH2 header will be added with MQ specific info otherwise JMS info will be added (jms_bytes, jms_text etc..).
IBM has some info about it

Resources