Service Test Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

How to set MQMD.ReplyToQ when putting message to MQ?

Occasional Visitor

How to set MQMD.ReplyToQ when putting message to MQ?

Hi,

 

When I send message to MQ I have to set MQMD.ReplyToQ field.

But in "Put Message to MQ Queue" step in Service Test I cannot find MQMD fields except of few (MessageId, CorrelId, Message format, Priority, etc).

 

Is there any way to set MQMD fields except of displayed on Property Sheet (maybe programmatically)?

 

Thank you,

Andrey.

 

1 REPLY
Occasional Advisor

Re: How to set MQMD.ReplyToQ when putting message to MQ?

Go to Events -> BeforeMQPutMEssage.

 

Now you have to write your custom code. Add the following namespace:

using IBM.WMQ;

 

 

Add the following code inside public void MQPutMessageToQueue6_OnBeforeMQPutMessage (...)

{

        args.MQMessage.ReplyToQueueName="YourQueueName";

}