public interface TopicMessage extends DataMessage
EMPTY_FIELD, EMPTY_FIELD_CHAR, EMPTY_FIELD_STRING, FIELD_DELIMITER, FIELD_DELIMITER_CHAR, FIELD_DELIMITER_STRING, FIELD_MU, LIST_DELIMITER, LIST_DELIMITER_CHAR, LIST_DELIMITER_STRING, MESSAGE_SEPARATOR, MESSAGE_SEPARATOR_CHAR, RECORD_DELIMITER, RECORD_DELIMITER_CHAR, RECORD_DELIMITER_STRING, RECORD_MU
Modifier and Type | Method and Description |
---|---|
TopicMessage |
duplicate()
Creates an exact duplicate of the message.
|
String |
getAckId()
Returns the ACK Id for the message.
|
long |
getAckTimeout()
Returns the 'ACK Timeout' value for the message (if set).
|
String |
getTopicName()
Returns the message topic name.
|
boolean |
isAckPending()
This indicates whether an inbound message that required acknowledgement
is yet to be acknowledged.
|
boolean |
isAckRequired()
Indicates whether the 'ACK Required' flag is set for the message.
|
boolean |
isDelta()
Returns true if a delta message.
|
boolean |
isFetchReply()
Is this message a response to a 'fetch' request?
|
boolean |
isFor(String topicPattern)
Indicates whether the message is for a named topic or topic pattern.
|
boolean |
isForTopic(String topicName)
Indicates whether the message is for a named topic.
|
boolean |
isPagedLoad()
Deprecated.
since 5.9
This topic type will be removed in a future release |
boolean |
isServiceLoad()
Deprecated.
since 5.9
This topic type will be removed in a future release |
boolean |
isTopicLoad()
Returns true if a Topic Load message.
|
boolean |
isTopicNotifyLoad()
Deprecated.
since 5.9
This topic type will be removed in a future release |
String |
setAckRequired()
Sets the 'ACK Required' flag on the message.
|
void |
setAckTimeout(long timeout)
Sets the 'ACK Timeout' value for this Message.
|
asByteBuffer, asBytes, asFields, asRecords, asRecords, asString, available, getCharset, getEncoding, getInputStream, getOutputStream, getReader, hasRemaining, length, nextByte, nextBytes, nextField, nextObject, nextRecord, nextRecord, put, put, put, put, put, putFields, putFields, putFields, putObject, putRecord, putRecord, putRecord, putRecords, putRecords, remaining, rewind, setCharset, setEncoding
getHeader, getHeaders, isTopicMessage, setHeaders, setHeaders, size, toMessage, toString
String getTopicName()
boolean isFor(String topicPattern)
This allows for handling of hierarchic topics but if it is known that the
argument is a full topic name then use of isForTopic(String)
is
more efficient.
topicPattern
- a full topic name or topic selector pattern.boolean isForTopic(String topicName)
topicName
- a full topic name.boolean isTopicLoad()
boolean isFetchReply()
boolean isDelta()
TopicMessage duplicate() throws MessageException
For a message that has the 'ACK Required' flag set a new ACK Id will be assigned to the new message. The ACK timeout value is also copied.
MessageException
- if unable to create a duplicate.String setAckRequired() throws MessageException
Setting the 'ACK Required' flag indicates that recipient(s) must
acknowledge receipt of the Message within a specified ACK timeout period
(see setAckTimeout(long)
.
If the recipient does not respond with an ACK then notification is sent
to an appropriate listener (see
ServerConnection.setAckListener(ServerAckListener)
for Messages
sent from Client to Server and
ClientAckListener
for Messages sent from Server to Client).
This flag must be set on a message before any user headers or data are added to the message.
It is important to note that a message that has the 'ACK Required' flag
set may only be used (sent or published) once. If there is a need to
repeatedly send such a message then a duplicate should be taken as the
duplicate()
method will assign a new ACK Id.
ACK processing is only currently available for messages sent from Server
to Client via the
TopicProvider
interface or from Client to Server via
ServerConnection.send(TopicMessage)
. If 'ACK Required' is set for
a message sent via any other interface then an exception will occur on
sending.
Only messages that are set as requiring acknowledgment are guaranteed for
delivery on reconnection. It is important that when reconnect is in use
that the ack timeout
is sufficiently long to
allow for the configured reconnect keep alive time.
MessageException
- if the 'ACK Required' flag is already set for
this message or user headers or data have already been written to
the message.boolean isAckRequired()
boolean isAckPending()
A Message can only be in an ACK Pending state if Messages are manually acknowledged.
String getAckId()
A message will only have an ACK Id if setAckRequired()
has been
called (or if it is a duplicate of such a message).
void setAckTimeout(long timeout)
The value set is only used if setAckRequired()
is called for the
Message.
If a timeout is not explicitly set for a Message that has the 'ACK required' flag set then a default value will be used.
timeout
- ACK timeout value in milliseconds. A non positive value
indicates a default should be used.long getAckTimeout()
@Deprecated boolean isServiceLoad()
This topic type will be removed in a future release
When such a message is received a ServiceTopicHandler
should be
created to handle it.
See ServiceTopicData
for full details.
@Deprecated boolean isPagedLoad()
This topic type will be removed in a future release
When such a message is received a PagedTopicHandler
should be
created to handle it.
See PagedTopicData
for full details.
@Deprecated boolean isTopicNotifyLoad()
This topic type will be removed in a future release
When such a message is received a TopicNotifyTopicHandler
should
be created to handle it.
See
TopicNotifyTopicData
for full details.
Copyright © 2016 Push Technology Ltd. All Rights Reserved.