Class MessageQueue
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue
com.swiftmq.impl.queue.standard.queue.MessageQueue
- All Implemented Interfaces:
Iterable
,Collection
,Queue
-
Field Summary
Modifier and TypeFieldDescriptionprotected OrderedSet
protected int
protected boolean
-
Constructor Summary
ConstructorDescriptionMessageQueue
(SwiftletContext ctx, Cache cache, PersistentStore pStore, NonPersistentStore nStore, long cleanUpDelay) -
Method Summary
Modifier and TypeMethodDescriptionvoid
acknowledgeMessage
(Object tId, MessageIndex messageIndex) void
acknowledgeMessage
(Object tId, MessageIndex messageIndex, AsyncCompletionCallback callback) void
acknowledgeMessages
(Object tId, List messageIndexList, AsyncCompletionCallback callback) void
activate
(boolean b) void
addWireTapSubscriber
(String name, WireTapSubscriber subscriber) protected void
protected void
buildPreparedTransaction
(PrepareLogRecord record) void
void
void
void
int
createView
(Selector selector) void
void
deleteView
(int viewId) long
getCache()
int
int
CompositeStoreTransaction
int
int
int
int
MessageEntry
getExpiredMessage
(Object tId, long timeout) MessageIndex
getIndexEntry
(MessageIndex messageIndex) MessageEntry
getMessage
(Object transactionId) MessageEntry
getMessage
(Object transactionId, long timeout) MessageEntry
getMessage
(Object transactionId, Selector selector) MessageEntry
getMessage
(Object transactionId, Selector selector, int viewId) MessageEntry
getMessage
(Object tId, Selector selector, int viewId, long timeout) MessageEntry
getMessage
(Object tId, Selector selector, long timeout) MessageEntry
getMessageByIndex
(MessageIndex messageIndex) protected long
long
int
int
getQueueIndex
(int viewId) boolean
hasReceiver
(MessageImpl message) protected void
insertDuplicateBacklog
(String jmsMsgId, StoreId storeId) boolean
isActive()
boolean
void
void
moveToTransaction
(MessageIndex messageIndex, Object destTxId) void
moveToTransaction
(MessageIndex messageIndex, Object sourceTxId, Object destTxId) long
moveToTransactionReturnSize
(MessageIndex messageIndex, Object destTxId) long
moveToTransactionReturnSize
(MessageIndex messageIndex, Object sourceTxId, Object destTxId) void
void
putMessage
(Object tId, MessageImpl message) void
receiverClosed
(long receiverId) void
registerMessageProcessor
(MessageProcessor messageProcessor) protected void
removeFromDuplicateLog
(String jmsMsgId, StoreId storeId) void
removeMessageByIndex
(MessageIndex messageIndex) void
removeMessages
(Object tId, List<MessageIndex> messageIndexes) void
removeWireTapSubscriber
(String name, WireTapSubscriber subscriber) void
void
void
void
void
setAlwaysDeliverExpired
(boolean alwaysDeliverExpired) void
setCompositeStoreTransaction
(Object txId, CompositeStoreTransaction compositeTx) void
setConsumerMode
(int consumerMode) protected void
setDuplicateDetectionBacklogSize
(int duplicateDetectionBacklogSize) protected void
setDuplicateDetectionEnabled
(boolean duplicateDetectionEnabled) void
setFlowController
(FlowController flowController) void
void
void
timeoutMessageProcessor
(long registrationTime, int id) void
unlockQueue
(Object txId, boolean markAsyncActive) void
unmarkAsyncActive
(Object txId) void
unregisterMessageProcessor
(MessageProcessor messageProcessor) Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Field Details
-
queueContent
-
duplicateBacklog
protected OrderedSet duplicateBacklog -
duplicateDetectionEnabled
protected boolean duplicateDetectionEnabled -
duplicateDetectionBacklogSize
protected int duplicateDetectionBacklogSize
-
-
Constructor Details
-
MessageQueue
public MessageQueue(SwiftletContext ctx, Cache cache, PersistentStore pStore, NonPersistentStore nStore, long cleanUpDelay)
-
-
Method Details
-
addWireTapSubscriber
-
removeWireTapSubscriber
-
getNextMsgId
protected long getNextMsgId() -
setAlwaysDeliverExpired
public void setAlwaysDeliverExpired(boolean alwaysDeliverExpired) -
getCache
-
getCacheSize
public int getCacheSize() -
getCacheSizeKB
public int getCacheSizeKB() -
getCurrentCacheSizeMessages
public int getCurrentCacheSizeMessages() -
getCurrentCacheSizeKB
public int getCurrentCacheSizeKB() -
setDuplicateDetectionEnabled
protected void setDuplicateDetectionEnabled(boolean duplicateDetectionEnabled) -
setDuplicateDetectionBacklogSize
protected void setDuplicateDetectionBacklogSize(int duplicateDetectionBacklogSize) -
setFlowController
public void setFlowController(FlowController flowController) -
buildDuplicateBacklog
protected void buildDuplicateBacklog() -
insertDuplicateBacklog
-
startQueue
public void startQueue() throws QueueException- Throws:
QueueException
-
stopQueue
public void stopQueue() throws QueueException- Throws:
QueueException
-
isRunning
public boolean isRunning() -
createPushTransaction
- Throws:
QueueException
-
createPullTransaction
- Throws:
QueueException
-
createView
public int createView(Selector selector) -
deleteView
public void deleteView(int viewId) -
buildPreparedTransaction
- Throws:
QueueException
-
beforeTransactionComplete
protected void beforeTransactionComplete() -
prepare
- Throws:
QueueException
-
commit
- Throws:
QueueException
-
commit
- Throws:
QueueException
-
commit
-
removeFromDuplicateLog
-
rollback
public void rollback(Object localTxId, XidImpl globalTxId, boolean setRedelivered) throws QueueException - Throws:
QueueException
-
rollback
- Throws:
QueueException
-
rollback
-
cleanUpExpiredMessages
public void cleanUpExpiredMessages() throws QueueException- Throws:
QueueException
-
getNumberQueueMessages
public long getNumberQueueMessages() throws QueueException- Throws:
QueueException
-
getConsumingRate
public int getConsumingRate() -
getProducingRate
public int getProducingRate() -
getConsumedTotal
public int getConsumedTotal() -
getProducedTotal
public int getProducedTotal() -
getAndResetAverageLatency
public long getAndResetAverageLatency() -
resetCounters
public void resetCounters() -
getMessage
- Throws:
QueueException
-
getMessage
- Throws:
QueueException
-
getMessage
public MessageEntry getMessage(Object transactionId, long timeout) throws QueueException, QueueTimeoutException - Throws:
QueueException
QueueTimeoutException
-
getExpiredMessage
public MessageEntry getExpiredMessage(Object tId, long timeout) throws QueueException, QueueTimeoutException - Throws:
QueueException
QueueTimeoutException
-
getMessage
public MessageEntry getMessage(Object tId, Selector selector, long timeout) throws QueueException, QueueTimeoutException - Throws:
QueueException
QueueTimeoutException
-
getMessage
public MessageEntry getMessage(Object transactionId, Selector selector, int viewId) throws QueueException - Throws:
QueueException
-
getMessage
public MessageEntry getMessage(Object tId, Selector selector, int viewId, long timeout) throws QueueException, QueueTimeoutException - Throws:
QueueException
QueueTimeoutException
-
registerMessageProcessor
public void registerMessageProcessor(MessageProcessor messageProcessor) -
unregisterMessageProcessor
public void unregisterMessageProcessor(MessageProcessor messageProcessor) -
isActive
public boolean isActive() -
activate
public void activate(boolean b) -
setConsumerMode
public void setConsumerMode(int consumerMode) -
receiverClosed
public void receiverClosed(long receiverId) -
timeoutMessageProcessor
public void timeoutMessageProcessor(long registrationTime, int id) -
removeMessages
- Throws:
QueueException
-
acknowledgeMessage
- Throws:
QueueException
-
acknowledgeMessage
public void acknowledgeMessage(Object tId, MessageIndex messageIndex, AsyncCompletionCallback callback) -
acknowledgeMessages
-
moveToTransactionReturnSize
public long moveToTransactionReturnSize(MessageIndex messageIndex, Object sourceTxId, Object destTxId) throws QueueException - Throws:
QueueException
-
moveToTransaction
public void moveToTransaction(MessageIndex messageIndex, Object sourceTxId, Object destTxId) throws QueueException - Throws:
QueueException
-
moveToTransactionReturnSize
public long moveToTransactionReturnSize(MessageIndex messageIndex, Object destTxId) throws QueueException - Throws:
QueueException
-
moveToTransaction
- Throws:
QueueException
-
hasReceiver
public boolean hasReceiver(MessageImpl message) -
putMessage
- Throws:
QueueException
-
getQueueIndex
- Throws:
QueueException
-
getQueueIndex
- Throws:
QueueException
-
getMessageByIndex
public MessageEntry getMessageByIndex(MessageIndex messageIndex) throws QueueException - Throws:
QueueException
-
removeMessageByIndex
public void removeMessageByIndex(MessageIndex messageIndex) throws QueueException - Throws:
QueueException
-
getIndexEntry
public MessageIndex getIndexEntry(MessageIndex messageIndex) throws QueueException - Throws:
QueueException
-
deleteContent
public void deleteContent() throws QueueException- Throws:
QueueException
-
lockQueue
-
unlockQueue
-
unmarkAsyncActive
-
setCompositeStoreTransaction
-
getCompositeStoreTransaction
-