0

I'm connecting to a remote mq queue using pymqi. I'm using put method as normal but I would like to know if there are some way to set something symilar as JMSReplyTo on JMS system to get a synchronous response of my message.

The request queue and the response are created in the remote mq where I'm connecting.

JoshMc
  • 10,239
  • 2
  • 19
  • 38
GuillemOF
  • 1
  • 2

1 Answers1

1

Yes you can set ReplyToQ (JMSReplyTo) and No, there is no one-call function for getting synchronous response.

Look example page or example in source

Is short:

# Prepare a Message Descriptor for the request message.
md = pymqi.MD()
md.ReplyToQ = dyn_queue_name

# Send the message.
queue = pymqi.Queue(qmgr, request_queue)
queue.put(message, md)
Seyf
  • 305
  • 2
  • 10
  • Thanks Sey, but I saw that way. I introduced my replyto queue name on the message descriptor as you said, but now how can I get the response? I tryed to call my other queue, where the message should reply, but I get MQRC_NO_MSG_AVAILABLE. Do I have to get the answer in another way? – GuillemOF May 27 '19 at 08:23
  • I would like to add that I'm trying to replyTo an alias queue and not a dynamic queue. I only have the replyto queue name – GuillemOF May 27 '19 at 09:55
  • Please look at this [link](https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.1.0/com.ibm.mq.ref.dev.doc/q096750_.htm) Try to set MQMO_NONE for MatchOptions in GMO that you use for getting messages. But in real work, if you want to have synchronous responses, you should wait message with specified CorrelId, that match to MsgId of putted message. – Seyf May 27 '19 at 20:56