1 Reply Latest reply on Jul 5, 2011 5:37 PM by Clebert Suconic

    Object Message in HornetQ Core

    java into Newbie

      What is the ObjectMessage Equivalalent in HornetQ Core ?

       

      I want to send in a serialized object in the queue(I know its a costly operation as mentioned but i have no other choice). Jms provides this with the facility to do it in creating a Object Message Type and setting the Object ...Looking for a similar implementation in Core ?

       

      JMS:

      ObjectMessage objectMessage = session.createObjectMessage();

      objectMessage.setObject(order);

      queueSender.send(objectMessage);

       

      Core ?

      Any Pointers would be appreciated.

       

      I am using ClientMessage clientM = clientS.createMessage(false); to create the clientMessage but how do i put the

      Serializable object in my client Message

        • 1. Re: Object Message in HornetQ Core
          Clebert Suconic Master

          With the core api, you just send byte messages (with aggregated properties).

           

           

          You can just use ObjectOutputStream(ByteArrayOutputStream)

           

          then... msg.putBytes(byteArrayOutput.getBytes());

           

           

          That's pretty much what we do on the JMS ObjectMessage wrapper.

           

           

          (BTW: If JMS was being created today, I would fight against any other message type different than LargeMessages and BytesMessages ;-).. but that's a tangent of this conversation. All you need is a way to send Messages with aggregated bytes on it).