Reputation: 119
I have an application which uses IBM MQ to send out the request in a queue manager to a particular system B
.
The response corresponding to that request is then received back from system B
by the application in a sync call and then further business processing happens.
Since we are working on the offshore region, we do not actually send out the request to system B
but rather capture it ourselves using the MQJExplorer
tool and send back the response, which kind of simulates the prod. behaviour.
The problem here is, or i would say, the overhead is that we have to manually open the mqjexplorer tool, check the request, take a particular attribute from the request(lets say ID
), and send back ID+1
so that the application recognizes the response is for ID-1
request.
I would like to know if this particular thing can be automated, with some other tool, where i can define like whenever any such kind of request is received in for eg: MQ001
queue manager and its REQ
queue, just extract the ID
attribute, do a ID+1
and send back the response in RESP
queue of same qm.
Upvotes: 0
Views: 812
Reputation: 7496
If 'C' language is not your thing and prefer Java then have a read of a blog posting I did in 2017. It is a complete request/reply scenario with 2 applications: BEServer01.java and RQClient01.java
You can modify BEServer01.java to your liking (and remove the SQL code). BEServer01.java contains all of the code for getting a request message and sending a reply message. Simply replace the variable 'replyText' contents with the reply message that you want.
If you are not a programmer then there is another option but it does not modify the message contents. MQ Visual Edit has a component called: SIM Server. Its purpose is to simulate a server-side component. You configure what 'request' queue to get the messages from and what the reply message text will be. When a messages lands on the request queue, the SIM Server will retrieve it and send the reply message to the queue & queue manager specified in the MQMD's ReplyToQueueName and ReplyToQueueManagerName fields.
Upvotes: 0
Reputation: 7527
There are a pair of IBM supplied samples that come with IBM MQ:-
amqsreq0.c
- Sample C program that puts request messages to a message queue and shows the replies (example using REPLY queue)amqsecha.c
- Sample C program - echo messages to reply to queueThey are supplied to allow you to try out a request/reply application.
You already have the equivalent app to do the job that amqsreq0.c
does, and you could adapt amqsecha.c
to extract your ID
attribute, increment it, and then the sample already has the code to send the reply back.
It can be automated by running as a triggered application too.
Upvotes: 1