public class JournalMessageStore extends AbstractMessageStore
| Modifier and Type | Field and Description |
|---|---|
protected Set<org.apache.activeio.journal.RecordLocation> |
inFlightTxLocations |
protected org.apache.activeio.journal.RecordLocation |
lastLocation |
protected MessageStore |
longTermStore |
protected JournalPersistenceAdapter |
peristenceAdapter |
protected JournalTransactionStore |
transactionStore |
protected TransactionTemplate |
transactionTemplate |
destination, FUTURE, prioritizedMessages| Constructor and Description |
|---|
JournalMessageStore(JournalPersistenceAdapter adapter,
MessageStore checkpointStore,
ActiveMQDestination destination) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMessage(ConnectionContext context,
Message message)
Not synchronized since the Journal has better throughput if you increase
the number of concurrent writes that it is doing.
|
void |
addMessageReference(ConnectionContext context,
MessageId messageId,
long expirationTime,
String messageRef) |
org.apache.activeio.journal.RecordLocation |
checkpoint() |
org.apache.activeio.journal.RecordLocation |
checkpoint(Callback postCheckpointTest) |
MessageStore |
getLongTermMessageStore() |
Message |
getMessage(MessageId identity)
Looks up a message using either the String messageID or the
messageNumber.
|
int |
getMessageCount() |
String |
getMessageReference(MessageId identity) |
void |
recover(MessageRecoveryListener listener)
Replays the checkpointStore first as those messages are the oldest ones,
then messages are replayed from the transaction log and then the cache is
updated.
|
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 |
replayAddMessage(ConnectionContext context,
Message message) |
void |
replayRemoveMessage(ConnectionContext context,
MessageAck messageAck) |
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 |
setMemoryUsage(MemoryUsage memoryUsage) |
void |
start() |
void |
stop() |
addMessage, asyncAddQueueMessage, asyncAddQueueMessage, asyncAddTopicMessage, asyncAddTopicMessage, dispose, getDestination, isEmpty, isPrioritizedMessages, removeAsyncMessage, setPrioritizedMessagesprotected final JournalPersistenceAdapter peristenceAdapter
protected final JournalTransactionStore transactionStore
protected final MessageStore longTermStore
protected final TransactionTemplate transactionTemplate
protected org.apache.activeio.journal.RecordLocation lastLocation
protected Set<org.apache.activeio.journal.RecordLocation> inFlightTxLocations
public JournalMessageStore(JournalPersistenceAdapter adapter, MessageStore checkpointStore, ActiveMQDestination destination)
public void setMemoryUsage(MemoryUsage memoryUsage)
setMemoryUsage in interface MessageStoresetMemoryUsage in class AbstractMessageStorememoryUsage - The SystemUsage that is controlling the
destination's memory usage.public void addMessage(ConnectionContext context, Message message) throws IOException
context - contextIOExceptionpublic void replayAddMessage(ConnectionContext context, Message message)
public 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 replayRemoveMessage(ConnectionContext context, MessageAck messageAck)
public org.apache.activeio.journal.RecordLocation checkpoint() throws IOException
IOExceptionpublic org.apache.activeio.journal.RecordLocation checkpoint(Callback postCheckpointTest) throws IOException
IOExceptionpublic Message getMessage(MessageId identity) throws IOException
MessageStoreidentity - which contains either the messageID or the messageNumberIOExceptionpublic void recover(MessageRecoveryListener listener) throws Exception
listener - Exceptionpublic void start() throws Exception
start in interface Servicestart in class AbstractMessageStoreExceptionpublic void stop() throws Exception
stop in interface Servicestop in class AbstractMessageStoreExceptionpublic MessageStore getLongTermMessageStore()
public void removeAllMessages(ConnectionContext context) throws IOException
MessageStoreIOExceptionMessageStore.removeAllMessages(ConnectionContext)public void addMessageReference(ConnectionContext context, MessageId messageId, long expirationTime, String messageRef) throws IOException
IOExceptionpublic String getMessageReference(MessageId identity) throws IOException
IOExceptionpublic int getMessageCount() throws IOException
IOExceptionMessageStore.getMessageCount()public void recoverNextMessages(int maxReturned, MessageRecoveryListener listener) throws Exception
Exceptionpublic void resetBatching()
MessageStorepublic void setBatch(MessageId messageId) throws Exception
MessageStoresetBatch in interface MessageStoresetBatch in class AbstractMessageStoreExceptionCopyright © 2005–2017. All rights reserved.