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, indexListener, messageStoreStatistics, prioritizedMessages| Constructor and Description |
|---|
JournalMessageStore(JournalPersistenceAdapter adapter,
MessageStore checkpointStore,
org.apache.activemq.command.ActiveMQDestination destination) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMessage(ConnectionContext context,
org.apache.activemq.command.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,
org.apache.activemq.command.MessageId messageId,
long expirationTime,
String messageRef) |
org.apache.activeio.journal.RecordLocation |
checkpoint() |
org.apache.activeio.journal.RecordLocation |
checkpoint(Callback postCheckpointTest) |
MessageStore |
getLongTermMessageStore() |
org.apache.activemq.command.Message |
getMessage(org.apache.activemq.command.MessageId identity) |
int |
getMessageCount() |
String |
getMessageReference(org.apache.activemq.command.MessageId identity) |
long |
getMessageSize() |
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) |
void |
removeMessage(ConnectionContext context,
org.apache.activemq.command.MessageAck ack) |
void |
replayAddMessage(ConnectionContext context,
org.apache.activemq.command.Message message) |
void |
replayRemoveMessage(ConnectionContext context,
org.apache.activemq.command.MessageAck messageAck) |
void |
resetBatching() |
void |
setBatch(org.apache.activemq.command.MessageId messageId) |
void |
setMemoryUsage(MemoryUsage memoryUsage) |
void |
start() |
void |
stop() |
addMessage, asyncAddQueueMessage, asyncAddQueueMessage, asyncAddTopicMessage, asyncAddTopicMessage, dispose, getDestination, getIndexListener, getMessageStoreStatistics, isEmpty, isPrioritizedMessages, recoverMessageStoreStatistics, registerIndexListener, removeAsyncMessage, setPrioritizedMessages, updateMessageprotected 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, org.apache.activemq.command.ActiveMQDestination destination)
public void setMemoryUsage(MemoryUsage memoryUsage)
setMemoryUsage in interface MessageStoresetMemoryUsage in class AbstractMessageStorepublic void addMessage(ConnectionContext context, org.apache.activemq.command.Message message) throws IOException
IOExceptionpublic void replayAddMessage(ConnectionContext context, org.apache.activemq.command.Message message)
public void removeMessage(ConnectionContext context, org.apache.activemq.command.MessageAck ack) throws IOException
IOExceptionpublic void replayRemoveMessage(ConnectionContext context, org.apache.activemq.command.MessageAck messageAck)
public org.apache.activeio.journal.RecordLocation checkpoint() throws IOException
IOExceptionpublic org.apache.activeio.journal.RecordLocation checkpoint(Callback postCheckpointTest) throws IOException
IOExceptionpublic org.apache.activemq.command.Message getMessage(org.apache.activemq.command.MessageId identity) throws IOException
IOExceptionpublic void recover(MessageRecoveryListener listener) throws Exception
listener - Exceptionpublic void start() throws Exception
start in interface org.apache.activemq.Servicestart in class AbstractMessageStoreExceptionpublic void stop() throws Exception
stop in interface org.apache.activemq.Servicestop in class AbstractMessageStoreExceptionpublic MessageStore getLongTermMessageStore()
public void removeAllMessages(ConnectionContext context) throws IOException
IOExceptionMessageStore.removeAllMessages(ConnectionContext)public void addMessageReference(ConnectionContext context, org.apache.activemq.command.MessageId messageId, long expirationTime, String messageRef) throws IOException
IOExceptionpublic String getMessageReference(org.apache.activemq.command.MessageId identity) throws IOException
IOExceptionpublic int getMessageCount() throws IOException
getMessageCount in interface MessageStoregetMessageCount in class AbstractMessageStoreIOExceptionMessageStore.getMessageCount()public long getMessageSize() throws IOException
getMessageSize in interface MessageStoregetMessageSize in class AbstractMessageStoreIOExceptionpublic void recoverNextMessages(int maxReturned, MessageRecoveryListener listener) throws Exception
Exceptionpublic void resetBatching()
public void setBatch(org.apache.activemq.command.MessageId messageId) throws Exception
setBatch in interface MessageStoresetBatch in class AbstractMessageStoreExceptionCopyright © 2005–2017 The Apache Software Foundation. All rights reserved.