public class JDBCMessageStore extends AbstractMessageStore
Modifier and Type | Field and Description |
---|---|
protected JDBCAdapter |
adapter |
protected ActiveMQMessageAudit |
audit |
protected LinkedList<Long> |
pendingAdditions |
protected JDBCPersistenceAdapter |
persistenceAdapter |
protected WireFormat |
wireFormat |
destination, FUTURE, indexListener, messageStoreStatistics, 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(Message message,
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
|
String |
toString() |
void |
updateMessage(Message message) |
addMessage, asyncAddQueueMessage, asyncAddQueueMessage, asyncAddTopicMessage, asyncAddTopicMessage, dispose, getDestination, getIndexListener, getMessageSize, getMessageStoreStatistics, isEmpty, isPrioritizedMessages, recoverMessageStoreStatistics, registerIndexListener, removeAsyncMessage, setMemoryUsage, start, stop
protected final WireFormat wireFormat
protected final JDBCAdapter adapter
protected final JDBCPersistenceAdapter persistenceAdapter
protected ActiveMQMessageAudit audit
protected final LinkedList<Long> pendingAdditions
public JDBCMessageStore(JDBCPersistenceAdapter persistenceAdapter, JDBCAdapter adapter, WireFormat wireFormat, ActiveMQDestination destination, ActiveMQMessageAudit audit) throws IOException
IOException
public void addMessage(ConnectionContext context, Message message) throws IOException
MessageStore
context
- contextIOException
public void updateMessage(Message message) throws IOException
updateMessage
in interface MessageStore
updateMessage
in class AbstractMessageStore
IOException
public void addMessageReference(ConnectionContext context, MessageId messageId, long expirationTime, String messageRef) throws IOException
IOException
public Message getMessage(MessageId messageId) throws IOException
MessageStore
messageId
- which contains either the messageID or the messageNumberIOException
public String getMessageReference(MessageId messageId) throws IOException
IOException
public void removeMessage(ConnectionContext context, MessageAck ack) throws IOException
MessageStore
ack
- 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.IOException
public void recover(MessageRecoveryListener listener) throws Exception
MessageStore
Exception
public void removeAllMessages(ConnectionContext context) throws IOException
MessageStore
IOException
MessageStore.removeAllMessages(ConnectionContext)
public int getMessageCount() throws IOException
getMessageCount
in interface MessageStore
getMessageCount
in class AbstractMessageStore
IOException
public void recoverNextMessages(int maxReturned, MessageRecoveryListener listener) throws Exception
maxReturned
- listener
- Exception
MessageStore.recoverNextMessages(int,
org.apache.activemq.store.MessageRecoveryListener)
public void resetBatching()
MessageStore
MessageStore.resetBatching()
public void setBatch(MessageId messageId)
MessageStore
setBatch
in interface MessageStore
setBatch
in class AbstractMessageStore
public void setPrioritizedMessages(boolean prioritizedMessages)
MessageStore
setPrioritizedMessages
in interface MessageStore
setPrioritizedMessages
in class AbstractMessageStore
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.