I am using IBM MQ and Java to write a message as Bytes on to the queue. Problem here i am getting here is while reading this message from JMS client offcourse that is expected format,i am getting as "BytesMessage" instead of message in MQSTR format.
What properties i have to set while writing the message on to the queue ,so JMS client consume that message as Text instead of Byte?
Do i need to chnage any of the below properties or anything else?
openOptions =MQC.MQOO_OUTPUT
putOptions=MQC.MQPMO_SYNCPOINT
Below is the sample producer code,Here i am not mentioning entire code.
String message="text";
final MQMessage mqm = new MQMessage();
mqm.write(message.getBytes());
Regards,
Chaitu
解决方案
Well, if your message is going to be of text format only, then what's the point of writing as Bytes.
Instead, you can use other functions like:
String message="text";
MQMessage mqm = new MQMessage();
mqm.writeString(message);
Also, you can set the "format" property of your message to any valid format(MQRFH2, MQSTR etc) like:
mqm.format="MQSTR";