1 2 3 Previous Next 33 Replies Latest reply on Apr 12, 2010 6:55 PM by leosbitto

    Jwokkkyeob Qin Xi hydrogen

    wolfc

      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?

        • 1. Re: Jwokkkyeob Qin Xi hydrogen
          wolfc

          Sorry, the first part is Korean. My mistake.

          • 2. Re: Jwokkkyeob Qin Xi hydrogen
            timfox

            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

              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

                Huh?

                 

                What's Object.toString() got to do with Message.getJMSMessageID() ?

                • 5. Re: Jwokkkyeob Qin Xi hydrogen
                  wolfc

                  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

                    The message id is not a hex string.

                    • 7. Re: Jwokkkyeob Qin Xi hydrogen
                      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

                        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

                          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

                            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

                              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?

                              • 12. Re: Jwokkkyeob Qin Xi hydrogen
                                jmesnil
                                • 13. Re: Jwokkkyeob Qin Xi hydrogen
                                  timfox

                                  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

                                    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.

                                    1 2 3 Previous Next