Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Regarding MQ Queue message id

843807Mar 25 2006
Hi,
I have a file which contains the number of messages. I have extracted the fields from these messages & assigned to MQMessage object. but I am not able to assign the message id to this object. I have done something like this :

public void putQ(String fields[ ], data, MQQueue localQ) {

MQMessage msg = new MQMessage();
MQPutMessageOptions pmo = new MQPutMessageOptions();
msg.putDateTime = //assigned the date, time in Gregorian calendar format.
msg.format = //assigned the specific field

byte b [ ] = field[8].getBytes("Cp1252"); // fiels[8] contains message id in String format.

msg.messageId = b;

pmo.options = // set all context..

msg.writeString(data);

localQ.put(msg, pmo);
}

Here its assigning all the fields to MQMessage object except message id. If there are 10 messages in a file, for each message this function is called and the browser is displaying the same message 10 times instead of 10 different messages. But if i assign msg.messageId = MQC.MQMI_NONE, then it generates new message ids & displays all the messages correctly. Can someone please guide me how to assign the message ids that are extracted from a file so that i can displa all the messages with the message ids that are present in the file??
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 22 2006
Added on Mar 25 2006
0 comments
191 views