8 Replies Latest reply on Oct 7, 2009 12:38 AM by Clebert Suconic

    Read serialized bytes of Object Message as it arrives

    Ross Nicholson Apprentice

      Hopefully this will be an easily answered question.

      I have a need to be able to read the serialised bytes representing an object from a HornetQMessage (which is created as an Object Message). I just want to avoid unserializing the object and serializing it again (as it's expensive computing-wise).

      What would be the easiest way to do this?

      So far I have extended the HornetQMessage class and made the getBody() method public so I can get at the HornetQBuffer. Will calling array() or read(byte[]) allow me to get the serialized bytes of the object, or will this always give me the entire message including properties?

      I was hoping there would be a getBytes() method on the HornetQObjectMessage but I lucked out on that one!