public class ProxyTopicMessageStore extends java.lang.Object implements TopicMessageStore
| Constructor and Description |
|---|
ProxyTopicMessageStore(TopicMessageStore delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge(ConnectionContext context,
java.lang.String clientId,
java.lang.String subscriptionName,
MessageId messageId,
MessageAck ack)
Stores the last acknowledged messgeID for the given subscription so that
we can recover and commence dispatching messages from the last checkpoint
|
void |
addMessage(ConnectionContext context,
Message message)
Adds a message to the message store
|
void |
addMessage(ConnectionContext context,
Message message,
boolean canOptimizeHint)
Adds a message to the message store
|
void |
addSubsciption(SubscriptionInfo subscriptionInfo,
boolean retroactive)
Inserts the subscriber info due to a subscription change If this is
a new subscription and the retroactive is false, then the last message
sent to the topic should be set as the last message acknowledged by they
new subscription.
|
java.util.concurrent.Future<java.lang.Object> |
asyncAddQueueMessage(ConnectionContext context,
Message message)
Adds a message to the message store
|
java.util.concurrent.Future<java.lang.Object> |
asyncAddQueueMessage(ConnectionContext context,
Message message,
boolean canOptimizeHint)
Adds a message to the message store
|
java.util.concurrent.Future<java.lang.Object> |
asyncAddTopicMessage(ConnectionContext context,
Message message)
Adds a message to the message store
|
java.util.concurrent.Future<java.lang.Object> |
asyncAddTopicMessage(ConnectionContext context,
Message message,
boolean canOptimizeHint)
Adds a message to the message store
|
void |
deleteSubscription(java.lang.String clientId,
java.lang.String subscriptionName) |
void |
dispose(ConnectionContext context) |
SubscriptionInfo[] |
getAllSubscriptions()
Lists all the durable subscriptions for a given destination.
|
MessageStore |
getDelegate() |
ActiveMQDestination |
getDestination()
The destination that the message store is holding messages for.
|
Message |
getMessage(MessageId identity)
Looks up a message using either the String messageID or the
messageNumber.
|
int |
getMessageCount() |
int |
getMessageCount(java.lang.String clientId,
java.lang.String subscriberName)
Get the number of messages ready to deliver from the store to a durable
subscriber
|
boolean |
isEmpty()
flag to indicate if the store is empty
|
boolean |
isPrioritizedMessages() |
SubscriptionInfo |
lookupSubscription(java.lang.String clientId,
java.lang.String subscriptionName)
Finds the subscriber entry for the given consumer info
|
void |
recover(MessageRecoveryListener listener)
Recover any messages to be delivered.
|
void |
recoverNextMessages(int maxReturned,
MessageRecoveryListener listener) |
void |
recoverNextMessages(java.lang.String clientId,
java.lang.String subscriptionName,
int maxReturned,
MessageRecoveryListener listener)
For an active subscription - retrieve messages from the store for the
subscriber after the lastMessageId messageId
|
void |
recoverSubscription(java.lang.String clientId,
java.lang.String subscriptionName,
MessageRecoveryListener listener)
For the new subscription find the last acknowledged message ID and then
find any new messages since then and dispatch them to the subscription.
|
void |
removeAllMessages(ConnectionContext context)
Removes all the messages from the message store.
|
void |
removeAsyncMessage(ConnectionContext context,
MessageAck ack) |
void |
removeMessage(ConnectionContext context,
MessageAck ack)
Removes a message from the message store.
|
void |
resetBatching()
A hint to the Store to reset any batching state for the Destination
|
void |
resetBatching(java.lang.String clientId,
java.lang.String subscriptionName)
A hint to the Store to reset any batching state for a durable subscriber
|
void |
setBatch(MessageId messageId)
allow caching cursors to set the current batch offset when cache is exhausted
|
void |
setMemoryUsage(MemoryUsage memoryUsage) |
void |
setPrioritizedMessages(boolean prioritizedMessages)
A hint to the store to try recover messages according to priority
|
void |
start() |
void |
stop() |
public ProxyTopicMessageStore(TopicMessageStore delegate)
public MessageStore getDelegate()
public void addMessage(ConnectionContext context, Message message) throws java.io.IOException
MessageStoreaddMessage in interface MessageStorecontext - contextjava.io.IOExceptionpublic void addMessage(ConnectionContext context, Message message, boolean canOptimizeHint) throws java.io.IOException
MessageStoreaddMessage in interface MessageStorecontext - contextcanOptimizeHint - - give a hint to the store that the message may be consumed before it hits the diskjava.io.IOExceptionpublic Message getMessage(MessageId identity) throws java.io.IOException
MessageStoregetMessage in interface MessageStoreidentity - which contains either the messageID or the messageNumberjava.io.IOExceptionpublic void recover(MessageRecoveryListener listener) throws java.lang.Exception
MessageStorerecover in interface MessageStorejava.lang.Exceptionpublic void removeAllMessages(ConnectionContext context) throws java.io.IOException
MessageStoreremoveAllMessages in interface MessageStorejava.io.IOExceptionpublic void removeMessage(ConnectionContext context, MessageAck ack) throws java.io.IOException
MessageStoreremoveMessage in interface MessageStoreack - the ack request that cause the message to be removed. It
conatins the identity which contains the messageID of the
message that needs to be removed.java.io.IOExceptionpublic void start()
throws java.lang.Exception
public void stop()
throws java.lang.Exception
public SubscriptionInfo lookupSubscription(java.lang.String clientId, java.lang.String subscriptionName) throws java.io.IOException
TopicMessageStorelookupSubscription in interface TopicMessageStorejava.io.IOExceptionpublic void acknowledge(ConnectionContext context, java.lang.String clientId, java.lang.String subscriptionName, MessageId messageId, MessageAck ack) throws java.io.IOException
TopicMessageStoreacknowledge in interface TopicMessageStorejava.io.IOExceptionpublic void addSubsciption(SubscriptionInfo subscriptionInfo, boolean retroactive) throws java.io.IOException
TopicMessageStoreaddSubsciption in interface TopicMessageStorejava.io.IOExceptionpublic void deleteSubscription(java.lang.String clientId,
java.lang.String subscriptionName)
throws java.io.IOException
deleteSubscription in interface TopicMessageStorejava.io.IOExceptionpublic void recoverSubscription(java.lang.String clientId,
java.lang.String subscriptionName,
MessageRecoveryListener listener)
throws java.lang.Exception
TopicMessageStorerecoverSubscription in interface TopicMessageStorejava.lang.Exceptionpublic void recoverNextMessages(java.lang.String clientId,
java.lang.String subscriptionName,
int maxReturned,
MessageRecoveryListener listener)
throws java.lang.Exception
TopicMessageStorerecoverNextMessages in interface TopicMessageStorejava.lang.Exceptionpublic void resetBatching(java.lang.String clientId,
java.lang.String subscriptionName)
TopicMessageStoreresetBatching in interface TopicMessageStorepublic ActiveMQDestination getDestination()
MessageStoregetDestination in interface MessageStorepublic SubscriptionInfo[] getAllSubscriptions() throws java.io.IOException
TopicMessageStoregetAllSubscriptions in interface TopicMessageStorejava.io.IOExceptionpublic void setMemoryUsage(MemoryUsage memoryUsage)
setMemoryUsage in interface MessageStorememoryUsage - The SystemUsage that is controlling the
destination's memory usage.public int getMessageCount(java.lang.String clientId,
java.lang.String subscriberName)
throws java.io.IOException
TopicMessageStoregetMessageCount in interface TopicMessageStorejava.io.IOExceptionpublic int getMessageCount()
throws java.io.IOException
getMessageCount in interface MessageStorejava.io.IOExceptionpublic void recoverNextMessages(int maxReturned,
MessageRecoveryListener listener)
throws java.lang.Exception
recoverNextMessages in interface MessageStorejava.lang.Exceptionpublic void dispose(ConnectionContext context)
dispose in interface MessageStorepublic void resetBatching()
MessageStoreresetBatching in interface MessageStorepublic void setBatch(MessageId messageId) throws java.lang.Exception
MessageStoresetBatch in interface MessageStorejava.lang.Exceptionpublic boolean isEmpty()
throws java.lang.Exception
MessageStoreisEmpty in interface MessageStorejava.lang.Exceptionpublic java.util.concurrent.Future<java.lang.Object> asyncAddTopicMessage(ConnectionContext context, Message message) throws java.io.IOException
MessageStoreasyncAddTopicMessage in interface MessageStorecontext - contextjava.io.IOExceptionpublic java.util.concurrent.Future<java.lang.Object> asyncAddTopicMessage(ConnectionContext context, Message message, boolean canOptimizeHint) throws java.io.IOException
MessageStoreasyncAddTopicMessage in interface MessageStorecontext - contextcanOptimizeHint - - give a hint to the store that the message may be consumed before it hits the diskjava.io.IOExceptionpublic java.util.concurrent.Future<java.lang.Object> asyncAddQueueMessage(ConnectionContext context, Message message) throws java.io.IOException
MessageStoreasyncAddQueueMessage in interface MessageStorecontext - contextjava.io.IOExceptionpublic java.util.concurrent.Future<java.lang.Object> asyncAddQueueMessage(ConnectionContext context, Message message, boolean canOptimizeHint) throws java.io.IOException
MessageStoreasyncAddQueueMessage in interface MessageStorecontext - contextcanOptimizeHint - - give a hint to the store that the message may be consumed before it hits the diskjava.io.IOExceptionpublic void removeAsyncMessage(ConnectionContext context, MessageAck ack) throws java.io.IOException
removeAsyncMessage in interface MessageStorejava.io.IOExceptionpublic void setPrioritizedMessages(boolean prioritizedMessages)
MessageStoresetPrioritizedMessages in interface MessageStorepublic boolean isPrioritizedMessages()
isPrioritizedMessages in interface MessageStoreCopyright © 2005-2013 Red Hat, Inc.. All Rights Reserved.