public interface MessageGroupStore extends BasicMessageGroupStore
| Modifier and Type | Interface and Description |
|---|---|
static interface |
MessageGroupStore.MessageGroupCallback
Invoked when a MessageGroupStore expires a group.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMessagesToGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?>... messages)
Store messages with an association to a group id.
|
void |
completeGroup(java.lang.Object groupId)
Completes this MessageGroup.
|
int |
expireMessageGroups(long timeout)
Extract all expired groups (whose timestamp is older than the current time less the threshold provided) and call
each of the registered callbacks on them in turn.
|
MessageGroupMetadata |
getGroupMetadata(java.lang.Object groupId)
Obtain the group metadata without fetching any messages; must supply all other
group properties; may include the id of the first message.
|
int |
getMessageCountForAllMessageGroups()
Optional attribute giving the number of messages in the store over all groups.
|
int |
getMessageGroupCount()
Optional attribute giving the number of message groups.
|
java.util.Collection<org.springframework.messaging.Message<?>> |
getMessagesForGroup(java.lang.Object groupId)
Retrieve messages for the provided group id.
|
org.springframework.messaging.Message<?> |
getOneMessageFromGroup(java.lang.Object groupId)
Return the one
Message from MessageGroup. |
java.util.Iterator<MessageGroup> |
iterator() |
void |
registerMessageGroupExpiryCallback(MessageGroupStore.MessageGroupCallback callback)
Register a callback for when a message group is expired through
expireMessageGroups(long). |
MessageGroup |
removeMessageFromGroup(java.lang.Object key,
org.springframework.messaging.Message<?> messageToRemove)
|
void |
removeMessagesFromGroup(java.lang.Object key,
java.util.Collection<org.springframework.messaging.Message<?>> messages)
Persist the deletion of messages from the group.
|
void |
removeMessagesFromGroup(java.lang.Object key,
org.springframework.messaging.Message<?>... messages)
Persist the deletion of messages from the group.
|
void |
setLastReleasedSequenceNumberForGroup(java.lang.Object groupId,
int sequenceNumber)
Allows you to set the sequence number of the last released Message.
|
addMessageToGroup, getMessageGroup, messageGroupSize, pollMessageFromGroup, removeMessageGroup@ManagedAttribute int getMessageCountForAllMessageGroups()
java.lang.UnsupportedOperationException - if not implemented@ManagedAttribute int getMessageGroupCount()
java.lang.UnsupportedOperationException - if not implemented@Deprecated MessageGroup removeMessageFromGroup(java.lang.Object key, org.springframework.messaging.Message<?> messageToRemove)
removeMessagesFromGroup(java.lang.Object, java.util.Collection<org.springframework.messaging.Message<?>>)key - The groupId for the group containing the message.messageToRemove - The message to be removed.void removeMessagesFromGroup(java.lang.Object key,
java.util.Collection<org.springframework.messaging.Message<?>> messages)
key - The groupId for the group containing the message(s).messages - The messages to be removed.void removeMessagesFromGroup(java.lang.Object key,
org.springframework.messaging.Message<?>... messages)
key - The groupId for the group containing the message(s).messages - The messages to be removed.void registerMessageGroupExpiryCallback(MessageGroupStore.MessageGroupCallback callback)
expireMessageGroups(long).callback - A callback to execute when a message group is cleaned up.@ManagedOperation int expireMessageGroups(long timeout)
timeout - the timeout threshold to useregisterMessageGroupExpiryCallback(MessageGroupCallback)void setLastReleasedSequenceNumberForGroup(java.lang.Object groupId,
int sequenceNumber)
groupId - The group identifier.sequenceNumber - The sequence number.java.util.Iterator<MessageGroup> iterator()
MessageGroups.void completeGroup(java.lang.Object groupId)
groupId - The group identifier.MessageGroupMetadata getGroupMetadata(java.lang.Object groupId)
groupId - The group id.org.springframework.messaging.Message<?> getOneMessageFromGroup(java.lang.Object groupId)
Message from MessageGroup.groupId - The group identifier.Message.void addMessagesToGroup(java.lang.Object groupId,
org.springframework.messaging.Message<?>... messages)
groupId - The group id to store messages under.messages - The messages to add.java.util.Collection<org.springframework.messaging.Message<?>> getMessagesForGroup(java.lang.Object groupId)
groupId - The group id to retrieve messages for.