-
1. Re: Jwokkkyeob Qin Xi hydrogen
wolfc Apr 8, 2010 11:19 AM (in response to wolfc)Sorry, the first part is Korean. My mistake.
-
2. Re: Jwokkkyeob Qin Xi hydrogen
timfox Apr 8, 2010 11:23 AM (in response to wolfc)The only requirement for a valid JMS message id is that it starts with "ID:" - the rest can be any string, it's not limited to any particular charset or subset of characters.
So this is a valid JMS message id.
The reason we do it this way, rather than a hex string for example, is that the stringified form is smaller, which helps with performance.
-
3. Re: Jwokkkyeob Qin Xi hydrogen
wolfc Apr 8, 2010 11:40 AM (in response to timfox)http://java.sun.com/javase/6/docs/api/java/lang/Object.html#toString%28%29
The result should be a concise but informative representation that is easy for a person to read.
Now where shall we start refining this requirement?
-
4. Re: Jwokkkyeob Qin Xi hydrogen
timfox Apr 8, 2010 12:11 PM (in response to wolfc)Huh?
What's Object.toString() got to do with Message.getJMSMessageID() ?
-
5. Re: Jwokkkyeob Qin Xi hydrogen
wolfc Apr 8, 2010 12:46 PM (in response to timfox)The bit where I do message.toString()
Carlo de Wolf wrote:
When I do a message.toString() HornetQ gives me an ID in Chinese.
15:39:08,900 INFO [STDOUT] *** TopicTestMDB onMessage 1 HornetQMessage[ID:줛꼅ᑃ?溱慀䢆氢]:PERSISTENT
Can I have one in hex please?
-
6. Re: Jwokkkyeob Qin Xi hydrogen
timfox Apr 8, 2010 1:05 PM (in response to wolfc)The message id is not a hex string.
-
7. Re: Jwokkkyeob Qin Xi hydrogen
timfox Apr 8, 2010 1:15 PM (in response to timfox)To summarise, so we don't go around in circles again.
JMSMessageID does not have to be a hex string. It is quite legal for it to be any String as long as it is prefixed with ID:
If you're asking can we change our message id to be a hex string, the answer is no.
-
8. Re: Jwokkkyeob Qin Xi hydrogen
clebert.suconic Apr 8, 2010 3:02 PM (in response to timfox)I think Carlo is just asking us to change Message.toString() to print an HEX representation of the messageID. That shouldn't affect any performance.
Now, if the request is to actually change the ID, opposed to what i understood, then I second Tim.. but I don't think that was the request.
-
9. Re: Jwokkkyeob Qin Xi hydrogen
wolfc Apr 8, 2010 3:51 PM (in response to clebert.suconic)Yes, I'm just asking that. Having gibberish pop-up in a log scares people.
It would also depend on what is used in the (JMX) console as message id. Both have to be in sync.
-
10. Re: Jwokkkyeob Qin Xi hydrogen
timfox Apr 9, 2010 4:42 AM (in response to clebert.suconic)Clebert Suconic wrote:
I think Carlo is just asking us to change Message.toString() to print an HEX representation of the messageID. That shouldn't affect any performance.
Now you're talking nonsense too.
If you call toString() on a String object then it prints out that String, not some other String.
What's the point of printing out some hex string - it's not the message id!
-
11. Re: Jwokkkyeob Qin Xi hydrogen
jmesnil Apr 9, 2010 10:18 AM (in response to wolfc)Carlo de Wolf wrote:
Sorry, the first part is Korean. My mistake.
Mmh, there is a real bug here. It's a coincidence that it displays ideogram for you
The code generating JMSMessageID is bogus in HornetQMessageProducer#doSend() and the generated bytes does not correspond to a valid String.
I'm ending up with "HornetQMessage[ID:??????B?]:PERSISTENT" displayed too.
Why dealing with bytes and not use simply:
String uid = UUIDGenerator.getInstance().generateUUID().toString();
msg.getCoreMessage().setUserID(new SimpleString("ID:" + uid));
wdyt?
-
-
13. Re: Jwokkkyeob Qin Xi hydrogen
timfox Apr 9, 2010 11:15 AM (in response to jmesnil)In what sense is the string not valid? Just because you can't display all the chars doesn't make it invalid.
-
14. Re: Jwokkkyeob Qin Xi hydrogen
jmesnil Apr 9, 2010 11:20 AM (in response to timfox)Tim Fox wrote:
In what sense is the string not valid? Just because you can't display all the chars doesn't make it invalid.
If the chars can not be displayed, the JMSMessage ID is useless. How is the user supposed to make the difference between ID:??????B? and ID:??????B? ?
With such IDs, user can not use ID in management API, in correlation ID, etc.