org.apache.activemq.store.journal
Class JournalMessageStore
java.lang.Object
org.apache.activemq.store.AbstractMessageStore
org.apache.activemq.store.journal.JournalMessageStore
- All Implemented Interfaces:
- Service, MessageStore
- Direct Known Subclasses:
- JournalTopicMessageStore
public class JournalMessageStore
- extends AbstractMessageStore
A MessageStore that uses a Journal to store it's messages.
| Methods inherited from class org.apache.activemq.store.AbstractMessageStore |
addMessage, asyncAddQueueMessage, asyncAddQueueMessage, asyncAddTopicMessage, asyncAddTopicMessage, dispose, getDestination, isEmpty, isPrioritizedMessages, removeAsyncMessage, setPrioritizedMessages |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
peristenceAdapter
protected final JournalPersistenceAdapter peristenceAdapter
transactionStore
protected final JournalTransactionStore transactionStore
longTermStore
protected final MessageStore longTermStore
transactionTemplate
protected final TransactionTemplate transactionTemplate
lastLocation
protected org.apache.activeio.journal.RecordLocation lastLocation
inFlightTxLocations
protected java.util.Set<org.apache.activeio.journal.RecordLocation> inFlightTxLocations
JournalMessageStore
public JournalMessageStore(JournalPersistenceAdapter adapter,
MessageStore checkpointStore,
ActiveMQDestination destination)
setMemoryUsage
public void setMemoryUsage(MemoryUsage memoryUsage)
- Specified by:
setMemoryUsage in interface MessageStore- Overrides:
setMemoryUsage in class AbstractMessageStore
addMessage
public void addMessage(ConnectionContext context,
Message message)
throws java.io.IOException
- Not synchronized since the Journal has better throughput if you increase
the number of concurrent writes that it is doing.
- Throws:
java.io.IOException
replayAddMessage
public void replayAddMessage(ConnectionContext context,
Message message)
removeMessage
public void removeMessage(ConnectionContext context,
MessageAck ack)
throws java.io.IOException
- Throws:
java.io.IOException
replayRemoveMessage
public void replayRemoveMessage(ConnectionContext context,
MessageAck messageAck)
checkpoint
public org.apache.activeio.journal.RecordLocation checkpoint()
throws java.io.IOException
- Returns:
-
- Throws:
java.io.IOException
checkpoint
public org.apache.activeio.journal.RecordLocation checkpoint(Callback postCheckpointTest)
throws java.io.IOException
- Returns:
-
- Throws:
java.io.IOException
getMessage
public Message getMessage(MessageId identity)
throws java.io.IOException
- Throws:
java.io.IOException
recover
public void recover(MessageRecoveryListener listener)
throws java.lang.Exception
- 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.
- Parameters:
listener -
- Throws:
java.lang.Exception
start
public void start()
throws java.lang.Exception
- Specified by:
start in interface Service- Overrides:
start in class AbstractMessageStore
- Throws:
java.lang.Exception
stop
public void stop()
throws java.lang.Exception
- Specified by:
stop in interface Service- Overrides:
stop in class AbstractMessageStore
- Throws:
java.lang.Exception
getLongTermMessageStore
public MessageStore getLongTermMessageStore()
- Returns:
- Returns the longTermStore.
removeAllMessages
public void removeAllMessages(ConnectionContext context)
throws java.io.IOException
- Throws:
java.io.IOException- See Also:
MessageStore.removeAllMessages(ConnectionContext)
addMessageReference
public void addMessageReference(ConnectionContext context,
MessageId messageId,
long expirationTime,
java.lang.String messageRef)
throws java.io.IOException
- Throws:
java.io.IOException
getMessageReference
public java.lang.String getMessageReference(MessageId identity)
throws java.io.IOException
- Throws:
java.io.IOException
getMessageCount
public int getMessageCount()
throws java.io.IOException
- Returns:
-
- Throws:
java.io.IOException- See Also:
MessageStore.getMessageCount()
recoverNextMessages
public void recoverNextMessages(int maxReturned,
MessageRecoveryListener listener)
throws java.lang.Exception
- Throws:
java.lang.Exception
resetBatching
public void resetBatching()
setBatch
public void setBatch(MessageId messageId)
throws java.lang.Exception
- Specified by:
setBatch in interface MessageStore- Overrides:
setBatch in class AbstractMessageStore
- Throws:
java.lang.Exception
Copyright © 2005-2015 Red Hat, Inc.. All Rights Reserved.