@ProviderType
public interface XMLMessage
XMLMessage
describes a message that is sent or received.
XMLMessage
is a wrapper of a well-formed XML message content,
and optionally a binary attachment.
XMLMessage
objects are not safe for use by
multiple threads. For a discussion of multi-threading considerations when
publishing messages, see XMLMessageProducer
.Modifier and Type | Interface and Description |
---|---|
static interface |
XMLMessage.MessageUserPropertyConstants
An interface contains the Solace-defined message user properties.
|
static class |
XMLMessage.Outcome
Represents the type for supported message settlement outcome
|
Modifier and Type | Field and Description |
---|---|
static int |
MSGDUMP_BRIEF
A flag to control output of
XMLMessage.dump(int) ; display only the length of
the binary attachment, xml attachment, and user property maps. |
static int |
MSGDUMP_FULL
A flag to control output of
XMLMessage.dump(int) ; display the entire message
contents. |
Modifier and Type | Method and Description |
---|---|
void |
ackMessage()
Acknowledges the message.
|
void |
clearAttachment()
Deletes the attachment to the message.
|
void |
clearContent()
Clears the message content.
|
String |
dump()
Produces a human-readable dump of the message properties and its contents
(can be quite large).
|
String |
dump(int flags)
Produces a human-readable dump of the message properties and its
contents.
|
String |
getApplicationMessageId()
Gets the application message ID, a string for an application-specific
message identifier.
|
String |
getApplicationMessageType()
Gets the application message type.
|
String |
getAppMessageID()
Deprecated.
Renamed to
XMLMessage.getApplicationMessageId() . |
String |
getAppMessageType()
Deprecated.
Renamed to
XMLMessage.getApplicationMessageType() . |
ByteBuffer |
getAttachmentByteBuffer()
Gets a
ByteBuffer containing the message's binary
attachment. |
int |
getAttachmentContentLength()
Gets the length of the attachment.
|
Long |
getCacheRequestId()
Return the request ID set in the cache request.
|
List<Long> |
getConsumerIdList()
Gets a read-only list of consumer IDs set on this message.
|
int |
getContentLength()
The length of the message content.
|
String |
getCorrelationId()
Gets the correlation ID.
|
Object |
getCorrelationKey()
Gets the correlation key for the message.
|
User_Cos |
getCos()
Gets the Class of Service (CoS) value for this message.
|
boolean |
getDeliverToOne()
Deprecated.
|
int |
getDeliveryCount()
Get message delivery count.
|
DeliveryMode |
getDeliveryMode()
Gets the delivery mode of the message.
|
Destination |
getDestination()
Gets the destination this message was published to.
|
String |
getDestinationTopicSuffix()
Returns the string, without a leading delimiter, that is found after the
session's default ReplyTo base topic in an incoming message.
|
boolean |
getDiscardIndication()
Returns
true if one or more messages have been discarded
prior to the current message, else false . |
long |
getExpiration()
The UTC time (in milliseconds, from midnight, January 1, 1970 UTC) when the message is supposed to expire.
|
String |
getHTTPContentEncoding()
Gets the HTTP content encoding header value from interaction with an HTTP client.
|
String |
getHTTPContentType()
Gets the HTTP content type header value from interaction with an HTTP client.
|
String |
getMessageId()
Deprecated.
Use
XMLMessage.ackMessage() to acknowledge messages.
The message ID is only to be used for the purpose of acknowledgements.
No other meaning should be inferred from the value of the guaranteed message ID.
Returns the message ID set by JCSMP during send or reception. The message ID is the String representation of a 64-bit unsigned integer value identifying the message. On the receiving side, if messages received do not have message ID set by the appliance, JCSMP automatically assigns one and guarantees its uniqueness for a particular <subscriber; message type>.
Guaranteed messages delivered from the appliance have a appliance-assigned
message ID. Messages sent or received over the |
long |
getMessageIdLong()
Deprecated.
Use
XMLMessage.ackMessage() to acknowledge messages.
The message ID is only to be used for the purpose of acknowledgements.
No other meaning should be inferred from the value of the guaranteed message ID.
Returns the message ID set by JCSMP during send or reception. For
discussion of message ID assignment, see |
MessageType |
getMessageType()
Deprecated.
See
XMLMessage.getDeliveryMode() .
Gets the type of the message. Valid types are enumerated in MessageType :
|
int |
getPriority()
Returns priority value in the range of 0–255, or -1 if it is not set.
|
SDTMap |
getProperties()
Gets the user properties map.
|
long |
getReceiveTimestamp()
Gets the receive timestamp (in milliseconds, from midnight, January 1, 1970 UTC).
|
boolean |
getRedelivered()
Indicates if the message has been delivered by the appliance to the API before.
|
ReplicationGroupMessageId |
getReplicationGroupMessageId()
Get the Replication Group Message ID for the received message.
|
Destination |
getReplyTo()
Gets the replyTo destination
|
String |
getReplyToSuffix()
Returns the appended suffix to the session's default ReplyTo base topic
set as part of this message's ReplyTo topic destination.
|
String |
getSenderId()
Returns the Sender's ID.
|
String |
getSenderID()
Deprecated.
Renamed to
XMLMessage.getSenderId() . |
Long |
getSenderTimestamp()
Gets the send timestamp (in milliseconds, from midnight, January 1, 1970
UTC).
|
Long |
getSendTimestamp()
Deprecated.
Renamed to
XMLMessage.getSenderTimestamp() . |
Long |
getSequenceNumber()
Gets the sequence number.
|
long |
getTimeToLive()
The number of milliseconds before the message is discarded or moved to
Dead Message Queue.
|
Long |
getTopicSequenceNumber()
Gets the topic sequence number generated by the appliance.
|
byte[] |
getUserData()
When an application sends a message, it can optionally attach
application-specific data along with the message, such as user data.
|
boolean |
hasAttachment()
Checks whether the message has an attachment.
|
boolean |
hasContent()
Checks whether the message has content.
|
boolean |
hasUserData()
Checks whether a received message includes user data.
|
boolean |
isAckImmediately()
Test if the ACK Immediately message property is set or not.
|
boolean |
isCacheMessage()
Returns
true if this message was part of a cache reply. |
boolean |
isDMQEligible()
The method returns whether the message is eligible to be moved to a Dead Message Queue (DMQ)
upon expiration.
|
boolean |
isElidingEligible()
Checks whether the message is eligible for eliding.
|
boolean |
isReadOnly()
Tests if the message is read only.
|
boolean |
isReplyMessage()
Returns whether the message's reply field is set, indicating that this
message is a reply.
|
boolean |
isSuspect()
Return
true if this message was part of a cache reply that had the suspect flag set. |
int |
readAttachmentBytes(byte[] byteOutputBuffer)
Reads bytes from an attachment, copying the data to the supplied byte
array.
|
int |
readAttachmentBytes(byte[] byteOutputBuffer,
int length)
Reads
length bytes from an attachment, copying the data to
the supplied byte array. |
int |
readAttachmentBytes(int srcPos,
byte[] byteOutputBuffer,
int destPos,
int length)
Reads
length bytes from an attachment, copying the data to
the supplied byte array. |
int |
readContentBytes(byte[] byteOutputBuffer)
Reads from the message content, copying the data to the supplied byte
array.
|
int |
readContentBytes(byte[] byteOutputBuffer,
int length)
Reads
length bytes from the message content, copying the
data to the supplied byte array. |
int |
readContentBytes(int srcPos,
byte[] byteOutputBuffer,
int destPos,
int length)
Reads
length bytes from the message content, copying the
data to the supplied byte array. |
void |
rejectMessage()
Deprecated.
As of version 4.0, rejectMessage has no separate effect from
ackMessage. Applications should avoid using this method as it
will be removed in a future release.
|
void |
reset()
Resets the message, clearing all fields, preparing it for publishing
again.
|
void |
rewindAttachment()
Deprecated.
This method no longer has any effect.
|
void |
setAckImmediately(boolean ackImmediately)
Set the ACK Immediately message property.
|
void |
setApplicationMessageId(String msgId)
Sets the message ID (a string for an application-specific message
identifier).
|
void |
setApplicationMessageType(String appMsgType)
Sets the application message type.
|
void |
setAppMessageID(String msgId)
Deprecated.
Renamed to
XMLMessage.setApplicationMessageId(String) . |
void |
setAppMessageType(String appMsgType)
Deprecated.
Renamed to
XMLMessage.setApplicationMessageType(String) . |
void |
setAsReplyMessage(boolean isReply)
Sets the reply field of the message.
|
void |
setCorrelationId(String id)
Sets the correlation ID.
|
void |
setCorrelationKey(Object key)
Sets the correlation key for the message.
|
void |
setCos(User_Cos cosValue)
Sets the Class of Service (CoS) value for this message.
|
void |
setDeliverToOne(boolean deliverToOne)
Deprecated.
|
void |
setDeliveryMode(DeliveryMode mode)
Sets the delivery mode of the message.
|
void |
setDMQEligible(boolean dmqEligible)
Set the message to be eligible to be moved to a Dead Message Queue.
|
void |
setElidingEligible(boolean eliding)
Sets whether the message is eligible for eliding.
|
void |
setExpiration(long expiration)
The UTC time (in milliseconds, from midnight, January 1, 1970 UTC) when the message is supposed to expire.
|
void |
setHTTPContentEncoding(String contentEncoding)
Sets the HTTP content type encoding value for interaction with an HTTP client.
|
void |
setHTTPContentType(String contentType)
Sets the HTTP content type header value for interaction with an HTTP client.
|
void |
setMessageType(MessageType msgType)
Deprecated.
See
XMLMessage.setDeliveryMode(DeliveryMode) .
Sets the type of the message. Valid types are enumerated in
MessageType :
|
void |
setPriority(int priority)
A message can optionally have priority set.
|
void |
setProperties(SDTMap props)
This method allows users to specify their own user properties to be
carried in the message separate from the payload.
|
void |
setReadOnly()
The message can be set as read only.
|
void |
setReplyTo(Destination destination)
Sets the replyTo destination for the message.
|
void |
setReplyToSuffix(String suffix)
Appends a String to the session's default ReplyTo base topic and creates
a ReplyTo Topic Destination.
|
void |
setSenderId(String senderId)
Sets the Sender ID for the message.
|
void |
setSenderID(String senderID)
Deprecated.
Renamed to
XMLMessage.setSenderId(String) . |
void |
setSenderTimestamp(long ts)
Allows the application to set the send timestamp, if so the API
will not generate a value.
|
void |
setSendTimestamp(long ts)
Deprecated.
Renamed to
XMLMessage.setSenderTimestamp(long) . |
void |
setSequenceNumber(long seqNum)
Sets the sequence number.
|
void |
setTimeToLive(long ttl)
The number of milliseconds before the message is discarded or moved to a
Dead Message Queue.
|
void |
settle(XMLMessage.Outcome outcome)
Settles a message in a requested way.
|
void |
setUserData(byte[] userData)
When an application sends a message, it can optionally attach
application-specific data along with the message as user data.
|
int |
writeAttachment(byte[] byteInputBuffer)
Writes a new attachment to the message.
|
int |
writeAttachment(byte[] byteInputBuffer,
int offset,
int length)
Writes a new attachment to the message.
|
int |
writeAttachment(InputStream stream)
Writes a new attachment to the message.
|
int |
writeNewAttachment(byte[] byteInputBuffer)
Deprecated.
Use
XMLMessage.writeAttachment(byte[]) instead |
int |
writeNewAttachment(byte[] byteInputBuffer,
int offset,
int length)
Deprecated.
Use
XMLMessage.writeAttachment(byte[],int,int) instead. |
int |
writeNewAttachment(InputStream stream)
Deprecated.
Use
XMLMessage.writeAttachment(InputStream) instead. |
int |
writeNewAttachment(InputStream stream,
int offset,
int length)
Deprecated.
Use
XMLMessage.writeAttachment(InputStream) instead. |
static final int MSGDUMP_BRIEF
XMLMessage.dump(int)
; display only the length of
the binary attachment, xml attachment, and user property maps.static final int MSGDUMP_FULL
XMLMessage.dump(int)
; display the entire message
contents.@Deprecated String getMessageId()
XMLMessage.ackMessage()
to acknowledge messages.
The message ID is only to be used for the purpose of acknowledgements.
No other meaning should be inferred from the value of the guaranteed message ID.
Returns the message ID set by JCSMP during send or reception. The message ID is the String representation of a 64-bit unsigned integer value identifying the message.
On the receiving side, if messages received do not have message ID set by the appliance, JCSMP automatically assigns one and guarantees its uniqueness for a particular <subscriber; message type>.
Guaranteed messages delivered from the appliance have a appliance-assigned
message ID. Messages sent or received over the Direct
delivery mode are assigned a message ID by the API, but its value is not
meaningful.
@Deprecated long getMessageIdLong()
XMLMessage.ackMessage()
to acknowledge messages.
The message ID is only to be used for the purpose of acknowledgements.
No other meaning should be inferred from the value of the guaranteed message ID.
Returns the message ID set by JCSMP during send or reception. For
discussion of message ID assignment, see XMLMessage.getMessageId()
.
byte[] getUserData()
hasUserData()
method to check
whether user data is present on a received message.
NOTE: The maximum length of the user data is 36 bytes.
null
if none is present.void setUserData(byte[] userData)
NOTE: The maximum length of user data is 36 bytes.
userData
- The user data - copied into the message object.boolean hasUserData()
true
if user data is present, false
otherwise.int getContentLength()
void setReadOnly()
IllegalAccessError
to be raised.boolean isReadOnly()
void setMessageType(MessageType msgType)
XMLMessage.setDeliveryMode(DeliveryMode)
.
Sets the type of the message. Valid types are enumerated in
MessageType
:
MessageType.NON_PERSISTENT
MessageType.PERSISTENT
MessageType.DIRECT
(default)
msgType
- An enumerated type (MessageType
) representing one of
the CSMP message types.MessageType getMessageType()
XMLMessage.getDeliveryMode()
.
Gets the type of the message. Valid types are enumerated in MessageType
:
MessageType.NON_PERSISTENT
MessageType.PERSISTENT
MessageType.DIRECT
(default)MessageType
representing one of the four message types.void setDeliveryMode(DeliveryMode mode)
mode
- An enumerated type (DeliveryMode
) representing one of
the CSMP delivery modes.DeliveryMode getDeliveryMode()
DeliveryMode
) representing one of the
CSMP delivery modes.int getPriority()
IllegalArgumentException
- priority is not set.void setPriority(int priority)
The valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest. Value -1 indicates the priority is not set and a default priority value is used instead.
priority
- parameterIllegalArgumentException
- an out-of-range value is passed in.void setCos(User_Cos cosValue)
cosValue
- Class of Service (CoS).User_Cos getCos()
long getTimeToLive()
void setTimeToLive(long ttl)
A value of 0 means the message never expires. The default value is 0.
Note: Calling this method with a value of 0 explicitly resets previously set message expiration to 0.
This property is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used in conjunction with other message types unless the message is promoted by the appliance to a Guaranteed message.
ttl
- The number of milliseconds the Guaranteed message is allowed to
live before delivery to a subscriber.IllegalArgumentException
- If a negative value is passed in, or a value greater than 10
years.long getExpiration()
A value of 0 means the message never expires. The default value is 0.
If TimeToLive is set to a value greater than 0 before sending, getExpiration() will have one of the following values:
JCSMPProperties.CALCULATE_MESSAGE_EXPIRATION
is set to true, getExpiration() returns
the sum of the message's TimeToLive and UTC value after the message is sent at the first send attempt. Otherwise,
getExpiration() returns 0.
JCSMPProperties.CALCULATE_MESSAGE_EXPIRATION
is set to true, getExpiration() returns the sum of TimeToLive and the UTC value when the message is received.
Otherwise, getExpiration returns 0.
This setting is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used for a Direct message unless the message is promoted by the appliance to a Guaranteed message.
void setExpiration(long expiration)
This field only serves as a reference as to when the message may expire. A value of 0 means the message never expires. The default value is 0.
Note: If TimeToLive is set to zero explicitly by application, any previously set Expiration is reset to 0.
This setting is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used for a Direct message unless the message is promoted by the appliance to a Guaranteed message.
expiration
- parameterIllegalArgumentException
- If a negative value is passed in.boolean isDMQEligible()
false
, the message is discarded upon expiration. The default value is
false
.
This setting is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used for a Direct message unless the message is promoted by the appliance to a Guaranteed message.
boolean
indicating whether the message is eligible to be moved to
a Dead Message Queue.void setDMQEligible(boolean dmqEligible)
false
.
This setting is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used for a Direct message unless the message is promoted by the appliance to a Guaranteed message.
dmqEligible
- Whether the message is eligible to be moved to a DMQ upon expiration.boolean getRedelivered()
boolean
indicating if the message has been delivered before.boolean getDiscardIndication()
true
if one or more messages have been discarded
prior to the current message, else false
. This indicates
congestion discards only and is not affected by message eliding.True
if prior messages have been discarded, else
false
.XMLMessage.isElidingEligible()
void ackMessage()
If a JCSMPSession
is configured to use
SUPPORTED_MESSAGE_ACK_CLIENT
, when a message is successfully received by
an application, the application must call this method to explicitly
acknowledge reception of the message in order to free system resources
associated with an unacknowledged message.
Note: If a JCSMPSession
is configured to use
JCSMPProperties.SUPPORTED_MESSAGE_ACK_AUTO
(the default behaviour),
the call to this method is ignored and a warning log is generated.
Acknowledged messages are removed from the appliance's message spool.
IllegalStateException
- If the consumer that received this message is closed. (A
runtime exception.)void settle(XMLMessage.Outcome outcome) throws JCSMPException
NOTE: Ignored on transacted flows
outcome
- type of the settlement outcome.InvalidOperationException
- can be thrown when settlementOutcome is null or the broker does not support specified
outcome option.JCSMPException
- can be thrown for some other internal reasonIllegalStateException
- If the consumer that received this message is closed. (A
runtime exception.)@Deprecated void rejectMessage()
JCSMPException
void clearContent()
IllegalAccessError
- If called on a read-only message.boolean hasContent()
True
if the message has content, false
otherwise.int readContentBytes(int srcPos, byte[] byteOutputBuffer, int destPos, int length)
length
bytes from the message content, copying the
data to the supplied byte array.
If the number of bytes to be read in the content is less than
length
, all content bytes are read into the array.
srcPos
- The starting position in the source array.byteOutputBuffer
- A destination byte array to fill.destPos
- The starting position in the destination array.length
- The number of bytes to read.int readContentBytes(byte[] byteOutputBuffer)
byteOutputBuffer
- A destination byte array to fill.int readContentBytes(byte[] byteOutputBuffer, int length)
length
bytes from the message content, copying the
data to the supplied byte array.
If the number of bytes to be read in the content is less than
length
, all content bytes are read into the array.
byteOutputBuffer
- A destination byte array to fill.length
- The number of bytes to read.void clearAttachment()
IllegalAccessError
- If called on a read-only message.boolean hasAttachment()
True
if the message has an attachment, false
otherwise.int getAttachmentContentLength()
ByteBuffer getAttachmentByteBuffer()
ByteBuffer
containing the message's binary
attachment. The buffer's position
is set to the beginning of
the attachment, its limit
set to the length of the
attachment, and its mark
is undefined.ByteBuffer
view wrapping a byte
array owned by this message. If no attachment is present in this
message, returns null
.int readAttachmentBytes(byte[] byteOutputBuffer)
If the length of the array is less than the number of bytes remaining to be read, the array is filled.
If the number of bytes to be read in the attachment is less than the length of the array, all attachment bytes are read into the array. Use XMLMessage.getAttachmentContentLength() to find the size of the attachment in order to provide a correctly-sized array.
byteOutputBuffer
- A byte array to fill with bytes from the attachment.int readAttachmentBytes(byte[] byteOutputBuffer, int length)
length
bytes from an attachment, copying the data to
the supplied byte array.
If the number of bytes to be read in the attachment is less than length
,
all attachment bytes are read into the array.
byteOutputBuffer
- A byte array to fill with bytes from the attachment.length
- The number of bytes to read.int readAttachmentBytes(int srcPos, byte[] byteOutputBuffer, int destPos, int length)
length
bytes from an attachment, copying the data to
the supplied byte array.
If the number of bytes to be read in the attachment is less than
length
, all attachment bytes are read into the array.
Parameter ordering mimics the semantics of System#arraycopy
.
srcPos
- The starting position in the source array.byteOutputBuffer
- A destination byte array to fill.destPos
- The starting position in the destination array.length
- The number of bytes to read.void rewindAttachment()
XMLMessage.readAttachmentBytes(byte[])
or
XMLMessage.readAttachmentBytes(byte[], int)
reads from the beginning of the attachment.int writeNewAttachment(byte[] byteInputBuffer)
XMLMessage.writeAttachment(byte[])
insteadbyteInputBuffer
- A byte array to copy as attachment content.int writeAttachment(byte[] byteInputBuffer)
This method copies the input bytes into the message.
byteInputBuffer
- A byte array to copy as attachment content.int writeNewAttachment(byte[] byteInputBuffer, int offset, int length) throws BufferUnderflowException
XMLMessage.writeAttachment(byte[],int,int)
instead.offset
or length
are negative, an
IllegalArgumentException is thrown.
If length
or offset
result in an attempt to
read past the end of the array, a BufferUnderflowException
is
thrown.byteInputBuffer
- A byte array to copy as attachment content.offset
- The offset from which to read bytes from the input buffer.length
- The number of bytes to copy.BufferUnderflowException
int writeAttachment(byte[] byteInputBuffer, int offset, int length) throws BufferUnderflowException
offset
or length
are negative, an
IllegalArgumentException is thrown.
If length
or offset
result in an attempt to
read past the end of the array, a BufferUnderflowException
is
thrown.
This method copies the input bytes into the message.
byteInputBuffer
- A byte array to copy as attachment content.offset
- The offset from which to read bytes from the input buffer.length
- The number of bytes to copy.BufferUnderflowException
- on errorint writeNewAttachment(InputStream stream, int offset, int length) throws IOException
XMLMessage.writeAttachment(InputStream)
instead.offset
or length
are negative, an
IllegalArgumentException is thrown.stream
- A stream from which to read attachment content.offset
- The offset from which to read bytes from the input stream.length
- The number of bytes to read from the stream.IOException
int writeNewAttachment(InputStream stream) throws IOException
XMLMessage.writeAttachment(InputStream)
instead.stream
- A stream from which to read attachment content.IOException
int writeAttachment(InputStream stream) throws IOException
This method copies the input bytes into the message.
stream
- A stream from which to read attachment content.IOException
boolean isAckImmediately()
false
.
This setting is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used for a Direct message.
This property, when set by a publisher, may or may not be removed by the appliance prior to delivery to a consumer, so message consumers must not rely on this property being present.
boolean
indicating whether the message should be ACKed by the appliance immediately upon receipt.void setAckImmediately(boolean ackImmediately)
false
.
This setting is only valid for Guaranteed messages (Persistent and Non-Persistent). It has no effect when used for a Direct message.
This property, when set by a publisher, may or may not be removed by the appliance prior to delivery to a consumer, so message consumers must not rely on this property being present.
ackImmediately
- Whether the message should be ACKed by the appliance immediately upon receipt.List<Long> getConsumerIdList()
0x00000000 - 0xFFFFFFFE
, and each
one indicates that the received message matched at least one subscription
with that consumer ID on the appliance.
Consumer IDs are only present once, even if multiple subscriptions with that consumer ID each have caused a match.
The return value is null
if no consumer IDs are set on the
message.
Destination getDestination()
Queue
or Topic
instance.null
if unavailable.Object getCorrelationKey()
JCSMPStreamingPublishCorrelatingEventHandler
.void setCorrelationKey(Object key)
JCSMPStreamingPublishCorrelatingEventHandler
. Only effective for
PERSISTENT
and NON-PERSISTENT
messages
(that is, Guaranteed Delivery).key
- The correlation key to associate with this message.String getSenderID()
XMLMessage.getSenderId()
.String getSenderId()
void setSenderID(String senderID)
XMLMessage.setSenderId(String)
.void setSenderId(String senderId)
senderId
- The Sender ID for the message.@Deprecated Long getSendTimestamp()
XMLMessage.getSenderTimestamp()
.@Deprecated void setSendTimestamp(long ts)
XMLMessage.setSenderTimestamp(long)
.Long getSenderTimestamp()
void setSenderTimestamp(long ts)
ts
- The value to set as the send timestamp.long getReceiveTimestamp()
String getAppMessageType()
XMLMessage.getApplicationMessageType()
.void setAppMessageType(String appMsgType)
XMLMessage.setApplicationMessageType(String)
.String getApplicationMessageType()
void setApplicationMessageType(String appMsgType)
appMsgType
- The application message type.Long getSequenceNumber()
Null
if it was not set on send.void setSequenceNumber(long seqNum)
seqNum
- The sequence number.String getAppMessageID()
XMLMessage.getApplicationMessageId()
.void setAppMessageID(String msgId)
XMLMessage.setApplicationMessageId(String)
.String getApplicationMessageId()
null
if it was not set on send.void setApplicationMessageId(String msgId)
msgId
- The message ID.SDTMap getProperties()
null
if no user
properties map has been set on this message.void setProperties(SDTMap props)
Producer
props
- The user properties map.void setAsReplyMessage(boolean isReply)
isReply
- Whether to set or clear the reply attribute.boolean isReplyMessage()
boolean
indicating the state of the reply field.Destination getReplyTo()
void setReplyTo(Destination destination)
destination
- The replyTo destination.IllegalArgumentException
- If topic is invalid.void setReplyToSuffix(String suffix)
suffix
- The suffix to append when setting a new ReplyTo destination on
this message.String getReplyToSuffix()
null
if unset or ReplyTo is not a
Topic.String getDestinationTopicSuffix()
getDestination()
) does not
begin with the session's default ReplyTo base topic, then
null
is returned.boolean getDeliverToOne()
False
by default.
true
if this message was configured to deliver to one client only.void setDeliverToOne(boolean deliverToOne)
False
by default.
When a direct message has the DeliverToOne property set to true , it can be delivered only to one client. For a Guaranteed Delivery message, this behavior only applies to the "demoted" direct copy of this message.
deliverToOne
- True to enable delivering to one client only.String getCorrelationId()
null
, if
unset.void setCorrelationId(String id)
id
- The correlation ID to associate with this message.boolean isCacheMessage()
true
if this message was part of a cache reply.true
if this message was part of a cache reply.boolean isSuspect()
true
if this message was part of a cache reply that had the suspect flag set.true
if this message was part of a cache reply that had the suspect flag set.Long getCacheRequestId()
null
if isCacheMessage()
is false
.void setElidingEligible(boolean eliding)
eliding
- Whether the message is eligible for eliding.isElidingEligible() for more information about
this feature.
boolean isElidingEligible()
Message eliding enables filtering of data to avoid transmitting every
single update to a subscribing client. It can be used to overcome slow
consumers or any situation where a slower message rate is desired.
Eliding can be applied to messages delivered to subscribers in
DIRECT
delivery mode.
Time-based eliding ensures that subscriber applications always receive only the most current update of a published topic at a rate that they can manage. By limiting the incoming message rate, a subscriber application is able to avoid a message backlog filled with outdated messages. This property does not indicate whether messages were elided or provide information about the subscriber profile eliding configuration.
void reset()
JCSMPFactory
.String dump()
dump(MSGDUMP_FULL)
.String
representation of the message, to be used
for debugging.String dump(int flags)
flags
- Flags controlling the output, such as whether to include
verbose (binary dump) informationString
representation of the message, to be used
for debugging.Long getTopicSequenceNumber()
Null
if it was not generated by the appliance.String getHTTPContentType()
null
if it is not set.void setHTTPContentType(String contentType)
contentType
- The HTTP content type header value.String getHTTPContentEncoding()
null
if it is not set.void setHTTPContentEncoding(String contentEncoding)
contentEncoding
- The HTTP content encoding header value.int getDeliveryCount() throws UnsupportedOperationException
UnsupportedOperationException
ReplicationGroupMessageId getReplicationGroupMessageId()
ReplayStartLocation
in a later flow to create
a request replay of all messages after this one.ReplicationGroupMessageId
or null if not present.Copyright 2004-2024 Solace Corporation. All rights reserved.