i am not able to set JMSMessageID when i publish a message to a queue

Hi,

I am trying to set JMSMessageID using

Message_id="5555";

tmessage.setJMSMessageID(MESSAGE_ID);

statement. but i could set that id. the EMS server is setting some id by default. is there any possibliity to change that id and give user definied id? if so let me know how to do that. the below code is receiver message log for your reference.

Received message: TextMessage={ Header={ JMSMessageID={ID:EMS-SERVER.CC046811102

1A:2} JMSDestination={Queue[TestStub_Queue]} JMSReplyTo={Queue[TestStub_Queue]}

JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={3} JMSType

={TextMessage} JMSTimestamp={Thu Jun 28 15:06:52 IST 2007} JMSExpiration={Thu Ju

Regards,

yasodhar.

[756 byte] By [Your-Answera] at [2007-11-27 9:08:16]
# 1
You will not be able to set the message id while sending a message. The JMS provider sets the id. It sounds like you want to use the correlation id (Message.setJMSCorrelationID()).Dwayne======= http://dropboxmq.sourceforge.net/
Myshkin5a at 2007-7-12 21:46:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
hi Dwayne,Thanks for your suggestion. why i cannot set JMSMessageID()? can you explain. if we cannot set this id, why the JMS API has given "message.setJMSMessageID" statement. i hope there is someother way to set this message id. isn't not?Regards,Yasodhar.
Your-Answera at 2007-7-12 21:46:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

You might want to read section 3.4.3 of the JMS spec. A JMS provider will use the setJMSMessageID() method when it sends a message. You may ask why does a JMS provider need a public interface to set the message id of its own message? Because JMS providers must be able to send messages of other implementations.

You can call setJMSMessageID() but the value is overwritten when the message is sent.

Myshkin5a at 2007-7-12 21:46:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...