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 » General IBM MQ Support » Problem using MQGET and MQPUT same Queue (isereis / AS/400 /

Post new topic  Reply to topic
 Problem using MQGET and MQPUT same Queue (isereis / AS/400 / « View previous topic :: View next topic » 
Author Message
ANJUMK
PostPosted: Tue Feb 24, 2015 12:17 am    Post subject: Problem using MQGET and MQPUT same Queue (isereis / AS/400 / Reply with quote

Newbie

Joined: 20 Oct 2014
Posts: 4

Dear Friends,

I have'nt code program which read and put the message form/to same queue. (Server program)

The requirnment is that client will send the request message in Queue A, and Server need to read message from Queue A and response to Queue A.

The logic i am looking is to filter incomming messages and ignore the response message with is lying the Queue A.

I have tried below mention guideline in MQSeries document, but it is reading all messages incomming as well response.

GMMO (10-digit signed integer)
Options controlling selection criteria used for MQGET" with various option,
MOMSGI
MOCORI
MOGRPI.

Please help me to solve this, and if possible help me to identify sample from to be used for the above requirnment from QMQMSAMP/QRPGLESRC so i can uitilize that.

Thanks in Advance.


Regards
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Feb 24, 2015 12:27 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
Location: UK

Don't do this. A good request - reply model is as follows.

Requestors put request messages into queue A

Server unconditionally gets request messages one at a time from queue A.

Server puts each reply into queue B (copying the incoming msgid to the outgoing correlid field in the reply message).

Requestors(s) get from queue B - matching their response on the correlid (which they know because they can take it from the put message msgid).

This way, one pair of queues can service any number of requestors at the same time.

Alternatively the server can use the incoming message's reply-to-q value to decide what queue to use for the reply message. This is useful if you want to use dynamic reply queues for example (to avoid having to match the response). However opening queues like this each time can be less efficient.

The server (and requestor) should aim to keep their queues open all the time rather than open and close them for each message.

The server should listen on the queue with MQGET MQGMO_WAIT to avoid any need to poll the queue.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
ANJUMK
PostPosted: Tue Feb 24, 2015 2:40 am    Post subject: Reply with quote

Newbie

Joined: 20 Oct 2014
Posts: 4

Hi Jedi Knight,

Thank you for advice, i also prefer what you have said, but vendor is instisting on 1 Queue model.

Anyways i am convincing him for 2 Queue model.

Thanks again

Regards
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Tue Feb 24, 2015 2:54 am    Post subject: Reply with quote

Grand Master

Joined: 17 Nov 2005
Posts: 1002
Location: New Zealand

Did the vendor say why they needed it to be a single queue. It sounds like someone has come up with a solution for a problem and there may be other, better solutions.

It is possible to use the same queue for the request and the reply but, like zpat says, it's not really a good idea.

Cheers,
Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Problem using MQGET and MQPUT same Queue (isereis / AS/400 /
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.