class: ActiveMqMessage
[26:14] (extern: com.lehman.aussom.ActiveMqMessage) extends: object
One wrapper for every JMS message type: text, bytes, map, stream, object, and the body-less base message. Headers and properties are shared by all types; the body methods error cleanly when called on the wrong type. Instances come from the ActiveMqSession create* methods and from receive() - there is no public constructor.
Methods
-
getMessageType ()
Gets this message's type.
- @r
Astring with text, bytes, map, stream, object, or message.
- @r
-
getText ()
Gets the body of a text message.
- @r
Astring with the body, or null when unset.
- @r
-
setText (
string Text)Sets the body of a text message.
- @p
Textis a string with the body. - @r
thisobject
- @p
-
writeBytes (
object Buff)Appends the contents of a Buffer to a bytes message.
- @p
Buffis a Buffer object with the bytes to append. - @r
thisobject
- @p
-
readBytes ()
Reads the full body of a bytes message.
- @r
ABuffer object with the body bytes.
- @r
-
setMapValue (
string Name, Value)Sets a named value on a map message. Strings, ints, doubles, bools, and Buffers are supported.
- @p
Nameis a string with the value name. - @p
Valueis the value to store. - @r
thisobject
- @p
-
getMapValue (
string Name)Reads a named value from a map message.
- @p
Nameis a string with the value name. - @r
Thestored value, or null when the name is missing.
- @p
-
getMapNames ()
Lists the names present in a map message.
- @r
Alist of strings with the value names.
- @r
-
writeValue (
Value)Appends a value to a stream message. Strings, ints, doubles, bools, and Buffers are supported.
- @p
Valueis the value to append. - @r
thisobject
- @p
-
readValue ()
Reads the next value from a stream message, starting from the beginning on a freshly written message.
- @r
Thenext value in the stream.
- @r
-
setObject (
Value)Sets the payload of an object message. Strings, ints, doubles, bools, lists, and maps convert to serializable Java values.
- @p
Valueis the payload. - @r
thisobject
- @p
-
getObject ()
Reads the payload of an object message. The connection must trust the payload's packages (setTrustedPackages).
- @r
Thepayload value.
- @r
-
getCorrelationId ()
Gets the correlation ID used to pair replies with requests.
- @r
Astring with the correlation ID, or null when unset.
- @r
-
setCorrelationId (
string Id)Sets the correlation ID used to pair replies with requests.
- @p
Idis a string with the correlation ID. - @r
thisobject
- @p
-
getReplyTo ()
Gets the destination replies should be sent to.
- @r
AnActiveMqDestination object, or null when unset.
- @r
-
setReplyTo (
object Dest)Sets the destination replies should be sent to.
- @p
Destis an ActiveMqDestination object. - @r
thisobject
- @p
-
getType ()
Gets the application-set JMS type header.
- @r
Astring with the type, or null when unset.
- @r
-
setType (
string Type)Sets the application JMS type header.
- @p
Typeis a string with the type. - @r
thisobject
- @p
-
getMessageId ()
Gets the broker-assigned message ID (set after send).
- @r
Astring with the message ID, or null before send.
- @r
-
getTimestamp ()
Gets the send timestamp (set after send).
- @r
Anint with milliseconds since the epoch.
- @r
-
getDestination ()
Gets the destination this message was sent to.
- @r
AnActiveMqDestination object, or null before send.
- @r
-
getDeliveryMode ()
Gets this message's delivery mode.
- @r
Astring with persistent or non_persistent.
- @r
-
getPriority ()
Gets this message's priority.
- @r
Anint from 0 to 9.
- @r
-
getExpiration ()
Gets the expiration timestamp.
- @r
Anint with milliseconds since the epoch, 0 for never.
- @r
-
getRedelivered ()
Reports whether the broker redelivered this message.
- @r
Abool with true for a redelivered message.
- @r
-
setProperty (
string Name, Value)Sets a typed property. The JMS property type follows the value type: string, int, double, or bool.
- @p
Nameis a string with the property name. - @p
Valueis the property value. - @r
thisobject
- @p
-
getProperty (
string Name)Reads a property by name.
- @p
Nameis a string with the property name. - @r
Theproperty value, or null when missing.
- @p
-
getPropertyNames ()
Lists this message's property names.
- @r
Alist of strings with the property names.
- @r
-
hasProperty (
string Name)Reports whether a property exists.
- @p
Nameis a string with the property name. - @r
Abool with true when the property exists.
- @p
-
setScheduledDelay (
int Ms)Delays delivery. The broker needs scheduler support enabled.
- @p
Msis an int with the delay in milliseconds. - @r
thisobject
- @p
-
setScheduledPeriod (
int Ms)Redelivers every period (with setScheduledRepeat). The broker needs scheduler support enabled.
- @p
Msis an int with the period in milliseconds. - @r
thisobject
- @p
-
setScheduledRepeat (
int Count)Sets how many times a periodic delivery repeats.
- @p
Countis an int with the repeat count. - @r
thisobject
- @p
-
setScheduledCron (
string Expr)Schedules delivery with a cron expression. The broker needs scheduler support enabled.
- @p
Expris a string with the cron expression. - @r
thisobject
- @p
-
ack ()
Acknowledges this message on a client or individual acknowledge session.
- @r
thisobject
- @r