public interface MessageMerger
A Message Merger is used by a conflation policy to merge two messages as part of the conflation process.
If supplied then the merger will be invoked to merge the current and new messages and the resulting message will be appended to the end of the queue or will replace the current message depending upon the conflation mode.
Modifier and Type | Method and Description |
---|---|
TopicMessage |
merge(TopicMessage currentMessage,
TopicMessage newMessage)
Merges the content of two messages to produce a new message.
|
TopicMessage merge(TopicMessage currentMessage, TopicMessage newMessage) throws APIException
currentMessage
- the current message queued for the client and
selected for conflation by a MessageMatcher
newMessage
- the new message that is being offered to the client
queue.
Mode REPLACE
processing.
If a new merged message is returned then it replaces
currentMessage in the queue.
If currentMessage is returned then it remains where is was in the
queue and newMessage is not queued.
If newMessage is returned then it will replace the currentMessage
in the queue.
If null is returned then the current message is not removed from
the queue and newMessage is added to the end of the queue (i.e.
no conflation occurs).
Mode APPEND
processing.
If a new merged message is returned then currentMessage is
removed from the queue and the new merged message is added to the
end of the queue.
If currentMessage is returned then it remains where is was in the
queue and the new message is not queued.
If newMessage is returned then currentMessage is removed form the
queue and newMessage added to the end of the queue.
If null is returned then the currentMessage is not removed from
the queue and newMessage is added to the end of the queue (i.e.
no conflation occurs).
APIException
- if the merge failsCopyright © 2016 Push Technology Ltd. All Rights Reserved.