I'm trying to put a message on a remote queue which is not defined locally on the queue manager (queue manager alias). I'm being told to put the remote queue manager name in the message transmission header so it will be routed to the appropriate transmission queue.
I'm able to connect to the internal queue manager with the following:
Hashtable properties = new Hashtable();
properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);
properties.Add(MQC.HOST_NAME_PROPERTY, hostName);
properties.Add(MQC.PORT_PROPERTY, port);
properties.Add(MQC.CHANNEL_PROPERTY, channelName);
MQQueueManager queueManager = new MQQueueManager(queueManagerName, properties);
I create the message and attempt to do the Put but I'm not sure where/how to set the transmission header to the destination queue manager name.
message = new MQMessage();
message.Format = MQC.MQFMT_STRING;
message.WriteString(messageString);
queueManager.Put( ???qName???, ???qmName???, message);
I've tried using a blank qName and get an [MQRC_REMOTE_Q_NAME_ERROR]
UPDATE: Turned out that they configured the queue manager alias incorrectly. The answer below helped me point it out to them. As the accepted answer states, MQ handles the message transmit header for you. Once it was configured correctly it was the same as putting a message on a locally defined remote queue.