Interface Message

  • All Known Subinterfaces:
    ClientMessage, ICoreMessage

    public interface Message
    A Message is a routable instance that has a payload.

    The payload (the "body") is opaque to the messaging system. A Message also has a fixed set of headers (required by the messaging system) and properties (defined by the users) that can be used by the messaging system to route the message (e.g. to ensure it matches a queue filter).

    Message Properties

    Message can contain properties specified by the users. It is possible to convert from some types to other types as specified by the following table:

     |        | boolean byte short int long float double String byte[]
     |----------------------------------------------------------------
     |boolean |    X                                      X
     |byte    |          X    X    X   X                  X
     |short   |               X    X   X                  X
     |int     |                    X   X                  X
     |long    |                        X                  X
     |float   |                              X     X      X
     |double  |                                    X      X
     |String  |    X     X    X    X   X     X     X      X
     |byte[]  |                                                   X
     |-----------------------------------------------------------------
     

    If conversion is not allowed (for example calling getFloatProperty on a property set a boolean), a ActiveMQPropertyConversionException will be thrown. User cases that will be covered by Message Receiving a buffer: Message encode = new CoreMessage(); // or any other implementation encode.receiveBuffer(buffer); Sending to a buffer: Message encode; size = encode.getEncodeSize(); encode.encodeDirectly(bufferOutput);