ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MQ Request-Response query

Post new topic  Reply to topic
 MQ Request-Response query « View previous topic :: View next topic » 
Author Message
meena05
PostPosted: Wed Jun 29, 2016 7:54 pm    Post subject: MQ Request-Response query Reply with quote

Apprentice

Joined: 26 Feb 2016
Posts: 39

Hi,

I have below scenario for IIB flow
1. Get records from database (unique is KEY)
2. send each database request record to MQ on request queue
3. Receive response on Reply Queue (Request-Reply will be processed by third party application
4. Based on response on reply queue update database to Success or Error (based on KEY value)
5. If reply received then SUCCESS . If reply is not received the ERROR.

How can I check in case I did not receive reply and update KEY record to ERROR? please help with any ideas
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Jun 29, 2016 10:28 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Save the MQ MessageId from each output message
Do an MQGET looking for the CORRELID that matched the MQ Message ID that was sent.
This is providing that the applicatino you are sending this to sends the replied with the MQ Message Id it gets from the message it reads as the MQMD.CORRELID

The MQGET can have a timeout set so if nothing is returns before it times out then you have an error.

If the Application you are sending to does not do it then you have to find out how they are proposing to sync the replied with the requests.
MQ Client Server 101 - Chapter 1
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
meena05
PostPosted: Thu Jun 30, 2016 8:56 am    Post subject: Reply with quote

Apprentice

Joined: 26 Feb 2016
Posts: 39

Thank you so much for your reply.

Yes the Application is mapping Request Message ID to response Correlation ID.

I have my first flow as below

MQ Input Node to trigger process -> Database Select Query (Compute Node) Propagate -> Add MQMD Header -> Store MQMD to local environment -> MQOutput NODE (Request queue) -> Build MQMD message body with Message ID -> MQOutput Node (local Queue ) for caching


Second flow

Reply Queue (MQ Input node) -> Compute node (Out = in) -> MQ Get (On local queue ) Request as InRoot MQMD -> Update database

These two flows are coordinating to see the replies coming up. If the reply does not come back then the messages are sitting on the local queue. In this case how can I handle the unprocessed messages in local queue to update database to ERROR?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jun 30, 2016 10:06 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

So you have what is essentially an asynchronous request reply.
Origin and final destination is the database.

So please hold the state in the DB. When extracting the record update it with the messages msgid.
In the second flow process all messages and link the response with the correlid on the message to the messageid saved in the DB.

Assumptions:
The second flow only receives responses to requests originating from the db.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
meena05
PostPosted: Thu Jun 30, 2016 10:54 am    Post subject: Reply with quote

Apprentice

Joined: 26 Feb 2016
Posts: 39

Thank you for your reply.

Can I have synchronous REQUEST-REPLY tracked in same message flow? how can I achieve this?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jun 30, 2016 10:09 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

meena05 wrote:
Thank you for your reply.

Can I have synchronous REQUEST-REPLY tracked in same message flow? how can I achieve this?

Yes.
After getting the records from the DB propagate a compute node that creates an MQ Message and sends it.
So all the selected records end up on a local Q (No the application one)

Add a new part of your flow that reads each message from this queue, created the application message and sends it. MQGET node with timeout to get the reply. Each request/reply to the application will be synchronous and if you don't have an additional instances then everything should be processed in the order it came out of the DB.

Each of these operations is a different (In IIB terms) transaction and isolated from any other one.

There are other ways to do this and I'm sure that someone else will be along to suggest one or more of them.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jul 01, 2016 4:49 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Using your previous design, put the message on the local queue (caching) with expiry and full report as a request to go to queue 3.
3rd flow, read message set DB in error.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MQ Request-Response query
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.