Why didn't my WebSphere MQ (on Windows) Exit API write anything when I sent messages through a Java-based client program?

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!

+3
source share
2 answers

I am sure that I remember reading somewhere that it writeUTF()displays information about the length as well as the string.


Oh yes, here it is:

IBM doco writeUTF():

ActiveX UTF. 2- , . DataOffset , .

( ). , WriteString() - .

+1

API, , . QMgr ?

, , . , .

, WMQ ? ( dspmq, .) APAR IC60172: 64-BIT WINDOWS API- EXITS64, 7.0.1.0 32- 64- , - .

, pax . Java, ActiveX, doco .

0

Source: https://habr.com/ru/post/1759094/


All Articles