I wrote the EXIT API for WebSphere MQ 7 on Windows, when I put or get a simple message from the command line from the queue, for example: " amqsput " or " amqsget ", I would get some log files containing information such as time, message data, queue name, etc.
This is what I expect for my test program written in Java, but when I used the code below:
MQMessage msg = new MQMessage ();
msg.writeUTF ("Hello, World!");
MQPutMessageOptions pmo = new MQPutMessageOptions ();
queue.put (msg, pmo);
I have an empty log file. Then I used the code below:
MQMessage msg = new MQMessage ();
msg.writeString ("Hello, World!");
MQPutMessageOptions pmo = new MQPutMessageOptions ();
queue.put (msg, pmo);
Then I saw familiar data in a log file.
I opened MQ explorer, I saw two messages in the "Message Browser":
Hello world! % Hello, World!
I'm completely lost here, where does this "%" come from? My api output didn't record put action due to encoding?
Any advice would be appreciated! Thank!
source
share