I have something like Message forwarder / router for MQ messages. I’m trying to forward messages based on some rules. This forwarding is simply done by receiving message from one queue, creating a new message (with same or modified content) and putting it to another queue. The existence of the forwarder should be as transparent as possible.
At the moment my problem is PutApplicationType message property. It looks like I cannot change this property. I have both .NET and Java sample implementation and I’m trying to simply use:
MQMessage forwardedMessage = new MQMessage();
forwardedMessage.putApplicationType = CMQC.MQAT_UNIX;
It doesn’t matter what value I try to use. .NET version always sends message with MQAT_DEFAULT / MQAT_WINDOWS_NT and Java version always sends message with MQAT_JAVA.
Is it possible to change this header? If not can it cause some issue to legacy systems if I don’t change the value? Why is it not possible to change the value?
Btw. forwarding original message also doesn’t work – my application will change PutApplicationType property as well.
Edit: If I use native C API will I be able to control content of this property?
As T.Rob, said you need to read the manaul (WMQ Using Java or WMQ Using .Net). Forwarding a message is not a simple task as you listed above. There are several options/parameters that need to be set correctly.
Here is a Java code snippet with all of the exception handling remove: