public class JDBCMessageStore extends AbstractMessageStore
| Modifier and Type | Field and Description |
|---|---|
protected JDBCAdapter |
adapter |
protected ActiveMQMessageAudit |
audit |
protected AtomicLong |
lastRecoveredPriority |
protected AtomicLong |
lastRecoveredSequenceId |
protected JDBCPersistenceAdapter |
persistenceAdapter |
protected WireFormat |
wireFormat |
destination, FUTURE, prioritizedMessages| Constructor and Description |
|---|
JDBCMessageStore(JDBCPersistenceAdapter persistenceAdapter,
JDBCAdapter adapter,
WireFormat wireFormat,
ActiveMQDestination destination,
ActiveMQMessageAudit audit) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMessage(ConnectionContext context,
Message message)
Adds a message to the message store
|
void |
addMessageReference(ConnectionContext context,
MessageId messageId,
long expirationTime,
String messageRef) |
Message |
getMessage(MessageId messageId)
Looks up a message using either the String messageID or the
messageNumber.
|
int |
getMessageCount() |
String |
getMessageReference(MessageId messageId) |
protected void |
onAdd(MessageId messageId,
long sequenceId,
byte priority) |
void |
recover(MessageRecoveryListener listener)
Recover any messages to be delivered.
|
void |
recoverNextMessages(int maxReturned,
MessageRecoveryListener listener) |
void |
removeAllMessages(ConnectionContext context)
Removes all the messages from the message store.
|
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 |
setBatch(MessageId messageId)
allow caching cursors to set the current batch offset when cache is exhausted
|
void |
setPrioritizedMessages(boolean prioritizedMessages)
A hint to the store to try recover messages according to priority
|
addMessage, asyncAddQueueMessage, asyncAddQueueMessage, asyncAddTopicMessage, asyncAddTopicMessage, dispose, getDestination, isEmpty, isPrioritizedMessages, removeAsyncMessage, setMemoryUsage, start, stopprotected final WireFormat wireFormat
protected final JDBCAdapter adapter
protected final JDBCPersistenceAdapter persistenceAdapter
protected AtomicLong lastRecoveredSequenceId
protected AtomicLong lastRecoveredPriority
protected ActiveMQMessageAudit audit
public JDBCMessageStore(JDBCPersistenceAdapter persistenceAdapter, JDBCAdapter adapter, WireFormat wireFormat, ActiveMQDestination destination, ActiveMQMessageAudit audit) throws IOException
IOExceptionpublic void addMessage(ConnectionContext context, Message message) throws IOException
MessageStorecontext - contextIOExceptionpublic void addMessageReference(ConnectionContext context, MessageId messageId, long expirationTime, String messageRef) throws IOException
IOExceptionpublic Message getMessage(MessageId messageId) throws IOException
MessageStoremessageId - which contains either the messageID or the messageNumberIOExceptionpublic String getMessageReference(MessageId messageId) throws IOException
IOExceptionpublic void removeMessage(ConnectionContext context, MessageAck ack) throws IOException
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.IOExceptionpublic void recover(MessageRecoveryListener listener) throws Exception
MessageStoreExceptionpublic void removeAllMessages(ConnectionContext context) throws IOException
MessageStoreIOExceptionMessageStore.removeAllMessages(ConnectionContext)public int getMessageCount() throws IOException
IOExceptionpublic void recoverNextMessages(int maxReturned, MessageRecoveryListener listener) throws Exception
maxReturned - listener - ExceptionMessageStore.recoverNextMessages(int,
org.apache.activemq.store.MessageRecoveryListener)public void resetBatching()
MessageStoreMessageStore.resetBatching()public void setBatch(MessageId messageId)
MessageStoresetBatch in interface MessageStoresetBatch in class AbstractMessageStorepublic void setPrioritizedMessages(boolean prioritizedMessages)
MessageStoresetPrioritizedMessages in interface MessageStoresetPrioritizedMessages in class AbstractMessageStoreCopyright © 2005–2017. All rights reserved.