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(Object groupId,
Message<?>... messages)
Store messages with an association to a group id.
|
void |
completeGroup(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(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.
|
Collection<Message<?>> |
getMessagesForGroup(Object groupId)
Retrieve messages for the provided group id.
|
Message<?> |
getOneMessageFromGroup(Object groupId)
Return the one
Message from MessageGroup . |
Iterator<MessageGroup> |
iterator() |
void |
registerMessageGroupExpiryCallback(MessageGroupStore.MessageGroupCallback callback)
Register a callback for when a message group is expired through
expireMessageGroups(long) . |
void |
removeMessagesFromGroup(Object key,
Collection<Message<?>> messages)
Persist the deletion of messages from the group.
|
void |
removeMessagesFromGroup(Object key,
Message<?>... messages)
Persist the deletion of messages from the group.
|
void |
setLastReleasedSequenceNumberForGroup(Object groupId,
int sequenceNumber)
Allows you to set the sequence number of the last released Message.
|
addMessageToGroup, getMessageGroup, messageGroupSize, pollMessageFromGroup, removeMessageGroup
@ManagedAttribute int getMessageCountForAllMessageGroups()
UnsupportedOperationException
- if not implemented@ManagedAttribute int getMessageGroupCount()
UnsupportedOperationException
- if not implementedvoid removeMessagesFromGroup(Object key, Collection<Message<?>> messages)
key
- The groupId for the group containing the message(s).messages
- The messages to be removed.void removeMessagesFromGroup(Object key, 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(Object groupId, int sequenceNumber)
groupId
- The group identifier.sequenceNumber
- The sequence number.Iterator<MessageGroup> iterator()
MessageGroup
s.void completeGroup(Object groupId)
groupId
- The group identifier.MessageGroupMetadata getGroupMetadata(Object groupId)
groupId
- The group id.Message<?> getOneMessageFromGroup(Object groupId)
Message
from MessageGroup
.groupId
- The group identifier.Message
.void addMessagesToGroup(Object groupId, Message<?>... messages)
groupId
- The group id to store messages under.messages
- The messages to add.Collection<Message<?>> getMessagesForGroup(Object groupId)
groupId
- The group id to retrieve messages for.