Interface Queue
-
- All Superinterfaces:
Bindable,CriticalComponent
- All Known Implementing Classes:
LastValueQueue,QueueImpl
public interface Queue extends Bindable, CriticalComponent
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_CONSUMERS_UNLIMITED
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidacknowledge(MessageReference ref)voidacknowledge(MessageReference ref, AckReason reason, ServerConsumer consumer)voidacknowledge(MessageReference ref, ServerConsumer consumer)voidacknowledge(Transaction tx, MessageReference ref)voidacknowledge(Transaction tx, MessageReference ref, AckReason reason, ServerConsumer consumer, boolean delivering)voidaddConsumer(Consumer consumer)voidaddHead(List<MessageReference> refs, boolean scheduling)voidaddHead(MessageReference ref, boolean scheduling)voidaddLingerSession(String sessionId)voidaddRedistributor(long delay)voidaddSorted(List<MessageReference> refs, boolean scheduling)voidaddSorted(MessageReference ref, boolean scheduling)voidaddTail(MessageReference ref)voidaddTail(MessageReference ref, boolean direct)booleanallowsReferenceCallback()the current queue and consumer settings will allow use of the Reference Execution and callback.LinkedListIterator<MessageReference>browserIterator()voidcancel(MessageReference reference, long timeBase)voidcancel(Transaction tx, MessageReference ref)voidcancel(Transaction tx, MessageReference ref, boolean ignoreRedeliveryCheck)voidcancelRedistributor()booleanchangeReferencePriority(long messageID, byte newPriority)intchangeReferencesPriority(Filter filter, byte newPriority)Pair<Boolean,Boolean>checkRedelivery(MessageReference ref, long timeBase, boolean ignoreRedeliveryDelay)voidclose()intdeleteAllReferences()intdeleteAllReferences(int flushLimit)default intdeleteMatchingReferences(int flushLImit, Filter filter)intdeleteMatchingReferences(int flushLImit, Filter filter, AckReason ackReason)intdeleteMatchingReferences(Filter filter)voiddeleteQueue()voiddeleteQueue(boolean removeConsumers)booleandeleteReference(long messageID)voiddeliverAsync()voiddeliverScheduledMessage(long messageId)cancels scheduled message with the corresponding message ID and sends it to the head of the queue.voiddeliverScheduledMessages()cancels scheduled messages and send them to the head of the queue.voiddeliverScheduledMessages(String filter)cancels scheduled messages which match the filter and send them to the head of the queue.voiddestroyPaging()intdurableDown(Message message)intdurableUp(Message message)default voiderrorProcessing(Consumer consumer, Throwable t, MessageReference messageReference)voidexpire(MessageReference ref)voidexpire(MessageReference ref, ServerConsumer consumer, boolean delivering)booleanexpireReference(long messageID)default voidexpireReferences()voidexpireReferences(Runnable done)intexpireReferences(Filter filter)Expire all the references in the queue which matches the filterbooleanflushExecutor()default voidflushOnIntermediate(Runnable runnable)voidforceDelivery()This method will make sure that any pending message (including paged message) will be delivereddefault voidforEach(Consumer<MessageReference> consumer)longgetAcknowledgeAttempts()SimpleStringgetAddress()longgetAutoDeleteDelay()longgetAutoDeleteMessageCount()intgetConsumerCount()longgetConsumerRemovedTimestamp()Collection<Consumer>getConsumers()intgetConsumersBeforeDispatch()ReferenceCountergetConsumersRefCount()This will hold a reference counter for every consumer present on the queue.SimpleStringgetDeadLetterAddress()longgetDelayBeforeDispatch()intgetDeliveringCount()Map<String,List<MessageReference>>getDeliveringMessages()Return a Map consisting of consumer.toString and its messages Delivering message is a property of the consumer, this method will aggregate the results per Server's consumer objectlonggetDeliveringSize()longgetDispatchStartTime()intgetDurableDeliveringCount()longgetDurableDeliveringSize()longgetDurableMessageCount()This is the number of the durable messages in the queuelonggetDurablePersistentSize()This is the persistent size of all the durable messages in the queueintgetDurableScheduledCount()longgetDurableScheduledSize()ExecutorgetExecutor()SimpleStringgetExpiryAddress()FiltergetFilter()intgetGroupBuckets()intgetGroupCount()SimpleStringgetGroupFirstKey()Map<SimpleString,Consumer>getGroups()LonggetID()SimpleStringgetLastValueKey()intgetMaxConsumers()longgetMessageCount()longgetMessagesAcknowledged()longgetMessagesAdded()longgetMessagesExpired()longgetMessagesKilled()longgetMessagesReplaced()SimpleStringgetName()PageSubscriptiongetPageSubscription()PagingStoregetPagingStore()longgetPersistentSize()This is the size of the messages in the queue when persisted on disk which is used for metrics tracking to give an idea of the amount of data on the queue to be consumed Note that this includes all messages on the queue, even messages that are non-durable which may only be in memorydefault QueueConfigurationgetQueueConfiguration()MessageReferencegetReference(long id)longgetRingSize()RoutingTypegetRoutingType()intgetScheduledCount()List<MessageReference>getScheduledMessages()longgetScheduledSize()SimpleStringgetUser()booleanhasMatchingConsumer(Message message)voidincrementMesssagesAdded()booleanisAutoCreated()booleanisAutoDelete()booleanisConfigurationManaged()booleanisDirectDeliver()booleanisDispatching()booleanisDurable()booleanisDurableMessage()The queue definition could be durable, but the messages could eventually be considered non durable.booleanisEnabled()booleanisExclusive()booleanisGroupRebalance()booleanisGroupRebalancePauseDispatch()booleanisInternalQueue()We can't send stuff to DLQ on queues used on clustered-bridge-communicationbooleanisLastValue()default booleanisMirrorController()booleanisNonDestructive()booleanisPaused()booleanisPersistedPause()if the pause was persistedbooleanisPurgeOnNoConsumers()default booleanisSwept()booleanisTemporary()LinkedListIterator<MessageReference>iterator()It will iterate through memory only (not paging)booleanmoveReference(long messageID, SimpleString toAddress, Binding binding, boolean rejectDuplicates)intmoveReferences(int flushLimit, Filter filter, SimpleString toAddress, boolean rejectDuplicates, int messageCount, Binding binding)intmoveReferences(int flushLimit, Filter filter, SimpleString toAddress, boolean rejectDuplicates, Binding binding)intmoveReferences(Filter filter, SimpleString toAddress, Binding binding)voidpause()Pauses the queue.voidpause(boolean persist)Pauses the queue.default MessageReferencepeekFirstMessage()voidpostAcknowledge(MessageReference ref, AckReason reason)voidpostAcknowledge(MessageReference ref, AckReason reason, boolean delivering)voidreacknowledge(Transaction tx, MessageReference ref)voidrecheckRefCount(OperationContext context)This is to perform a check on the counter againvoidrefDown(MessageReference messageReference)voidreferenceHandled(MessageReference ref)voidrefUp(MessageReference messageReference)voidreload(MessageReference ref)voidreloadPause(long recordID)voidremoveAddress()This method will push a removeAddress call into server's remove addressvoidremoveConsumer(Consumer consumer)voidremoveLingerSession(String sessionId)MessageReferenceremoveReferenceWithID(long id)MessageReferenceremoveWithSuppliedID(String serverID, long id, NodeStore<MessageReference> nodeStore)Remove item with a supplied non-negative (>= 0) ID.voidresetAllGroups()voidresetAllIterators()voidresetGroup(SimpleString groupID)voidresetMessagesAcknowledged()voidresetMessagesAdded()voidresetMessagesExpired()voidresetMessagesKilled()voidresume()Resumes the delivery of message for the queue.intretryMessages(Filter filter)default intretryMessages(Filter filter, Integer expectedHits)intsendMessagesToDeadLetterAddress(Filter filter)booleansendMessageToDeadLetterAddress(long messageID)booleansendToDeadLetterAddress(Transaction tx, MessageReference ref)voidsetConfigurationManaged(boolean configurationManaged)voidsetConsumersBeforeDispatch(int consumersBeforeDispatch)voidsetDelayBeforeDispatch(long delayBeforeDispatch)voidsetDispatching(boolean dispatching)voidsetEnabled(boolean value)voidsetExclusive(boolean value)voidsetFilter(Filter filter)voidsetGroupBuckets(int groupBuckets)voidsetGroupFirstKey(SimpleString groupFirstKey)voidsetGroupRebalance(boolean groupRebalance)voidsetGroupRebalancePauseDispatch(boolean groupRebalancePauseDisptach)voidsetInternalQueue(boolean internalQueue)voidsetMaxConsumer(int maxConsumers)default voidsetMirrorController(boolean mirrorController)voidsetNonDestructive(boolean nonDestructive)voidsetPurgeOnNoConsumers(boolean value)voidsetRingSize(long ringSize)voidsetRoutingType(RoutingType routingType)default voidsetSwept(boolean sweep)voidsetUser(SimpleString user)voidunproposed(SimpleString groupID)-
Methods inherited from interface org.apache.activemq.artemis.core.server.Bindable
route, routeWithAck
-
Methods inherited from interface org.apache.activemq.artemis.utils.critical.CriticalComponent
checkExpiration, getCriticalAnalyzer, measureCritical
-
-
-
-
Field Detail
-
MAX_CONSUMERS_UNLIMITED
static final int MAX_CONSUMERS_UNLIMITED
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
SimpleString getName()
-
getID
Long getID()
-
getFilter
Filter getFilter()
-
setFilter
void setFilter(Filter filter)
-
getPagingStore
PagingStore getPagingStore()
-
getPageSubscription
PageSubscription getPageSubscription()
-
getRoutingType
RoutingType getRoutingType()
-
setRoutingType
void setRoutingType(RoutingType routingType)
-
allowsReferenceCallback
boolean allowsReferenceCallback()
the current queue and consumer settings will allow use of the Reference Execution and callback. This is because
-
isDurable
boolean isDurable()
-
durableUp
int durableUp(Message message)
-
durableDown
int durableDown(Message message)
-
refUp
void refUp(MessageReference messageReference)
-
refDown
void refDown(MessageReference messageReference)
-
removeWithSuppliedID
MessageReference removeWithSuppliedID(String serverID, long id, NodeStore<MessageReference> nodeStore)
Remove item with a supplied non-negative (>= 0) ID. If the idSupplier returns < 0 the ID is considered a non value (null) and it will be ignored.- See Also:
LinkedList.setNodeStore(NodeStore)
-
isDurableMessage
boolean isDurableMessage()
The queue definition could be durable, but the messages could eventually be considered non durable. (e.g. purgeOnNoConsumers)- Returns:
-
isAutoDelete
boolean isAutoDelete()
-
isSwept
default boolean isSwept()
-
setSwept
default void setSwept(boolean sweep)
-
getAutoDeleteDelay
long getAutoDeleteDelay()
-
getAutoDeleteMessageCount
long getAutoDeleteMessageCount()
-
isTemporary
boolean isTemporary()
-
isAutoCreated
boolean isAutoCreated()
-
isPurgeOnNoConsumers
boolean isPurgeOnNoConsumers()
-
setPurgeOnNoConsumers
void setPurgeOnNoConsumers(boolean value)
-
isEnabled
boolean isEnabled()
-
setEnabled
void setEnabled(boolean value)
-
getConsumersBeforeDispatch
int getConsumersBeforeDispatch()
-
setConsumersBeforeDispatch
void setConsumersBeforeDispatch(int consumersBeforeDispatch)
-
getDelayBeforeDispatch
long getDelayBeforeDispatch()
-
setDelayBeforeDispatch
void setDelayBeforeDispatch(long delayBeforeDispatch)
-
getDispatchStartTime
long getDispatchStartTime()
-
isDispatching
boolean isDispatching()
-
setDispatching
void setDispatching(boolean dispatching)
-
isExclusive
boolean isExclusive()
-
setExclusive
void setExclusive(boolean value)
-
isLastValue
boolean isLastValue()
-
getLastValueKey
SimpleString getLastValueKey()
-
isNonDestructive
boolean isNonDestructive()
-
setNonDestructive
void setNonDestructive(boolean nonDestructive)
-
getMaxConsumers
int getMaxConsumers()
-
setMaxConsumer
void setMaxConsumer(int maxConsumers)
-
getGroupBuckets
int getGroupBuckets()
-
setGroupBuckets
void setGroupBuckets(int groupBuckets)
-
isGroupRebalance
boolean isGroupRebalance()
-
setGroupRebalance
void setGroupRebalance(boolean groupRebalance)
-
isGroupRebalancePauseDispatch
boolean isGroupRebalancePauseDispatch()
-
setGroupRebalancePauseDispatch
void setGroupRebalancePauseDispatch(boolean groupRebalancePauseDisptach)
-
getGroupFirstKey
SimpleString getGroupFirstKey()
-
setGroupFirstKey
void setGroupFirstKey(SimpleString groupFirstKey)
-
isConfigurationManaged
boolean isConfigurationManaged()
-
setConfigurationManaged
void setConfigurationManaged(boolean configurationManaged)
-
addLingerSession
void addLingerSession(String sessionId)
-
removeLingerSession
void removeLingerSession(String sessionId)
-
removeConsumer
void removeConsumer(Consumer consumer)
-
getConsumerCount
int getConsumerCount()
-
getConsumerRemovedTimestamp
long getConsumerRemovedTimestamp()
-
setRingSize
void setRingSize(long ringSize)
-
getRingSize
long getRingSize()
-
isMirrorController
default boolean isMirrorController()
-
setMirrorController
default void setMirrorController(boolean mirrorController)
-
getConsumersRefCount
ReferenceCounter getConsumersRefCount()
This will hold a reference counter for every consumer present on the queue. The ReferenceCounter will know what to do when the counter became zeroed. This is used to control what to do with temporary queues, especially on shared subscriptions where the queue needs to be deleted when all the consumers are closed.
-
addSorted
void addSorted(List<MessageReference> refs, boolean scheduling)
-
reload
void reload(MessageReference ref)
-
flushOnIntermediate
default void flushOnIntermediate(Runnable runnable)
-
addTail
void addTail(MessageReference ref)
-
addTail
void addTail(MessageReference ref, boolean direct)
-
addHead
void addHead(MessageReference ref, boolean scheduling)
-
addSorted
void addSorted(MessageReference ref, boolean scheduling)
-
addHead
void addHead(List<MessageReference> refs, boolean scheduling)
-
acknowledge
void acknowledge(MessageReference ref) throws Exception
- Throws:
Exception
-
acknowledge
void acknowledge(MessageReference ref, ServerConsumer consumer) throws Exception
- Throws:
Exception
-
acknowledge
void acknowledge(MessageReference ref, AckReason reason, ServerConsumer consumer) throws Exception
- Throws:
Exception
-
acknowledge
void acknowledge(Transaction tx, MessageReference ref) throws Exception
- Throws:
Exception
-
acknowledge
void acknowledge(Transaction tx, MessageReference ref, AckReason reason, ServerConsumer consumer, boolean delivering) throws Exception
- Throws:
Exception
-
reacknowledge
void reacknowledge(Transaction tx, MessageReference ref) throws Exception
- Throws:
Exception
-
cancel
void cancel(Transaction tx, MessageReference ref)
-
cancel
void cancel(Transaction tx, MessageReference ref, boolean ignoreRedeliveryCheck)
-
cancel
void cancel(MessageReference reference, long timeBase) throws Exception
- Throws:
Exception
-
deliverAsync
void deliverAsync()
-
unproposed
void unproposed(SimpleString groupID)
-
forceDelivery
void forceDelivery()
This method will make sure that any pending message (including paged message) will be delivered
-
removeAddress
void removeAddress() throws ExceptionThis method will push a removeAddress call into server's remove address- Throws:
Exception
-
getMessageCount
long getMessageCount()
-
getPersistentSize
long getPersistentSize()
This is the size of the messages in the queue when persisted on disk which is used for metrics tracking to give an idea of the amount of data on the queue to be consumed Note that this includes all messages on the queue, even messages that are non-durable which may only be in memory
-
getDurableMessageCount
long getDurableMessageCount()
This is the number of the durable messages in the queue
-
getDurablePersistentSize
long getDurablePersistentSize()
This is the persistent size of all the durable messages in the queue
-
getDeliveringCount
int getDeliveringCount()
-
getDeliveringSize
long getDeliveringSize()
-
getDurableDeliveringCount
int getDurableDeliveringCount()
-
getDurableDeliveringSize
long getDurableDeliveringSize()
-
referenceHandled
void referenceHandled(MessageReference ref)
-
getScheduledCount
int getScheduledCount()
-
getScheduledSize
long getScheduledSize()
-
getDurableScheduledCount
int getDurableScheduledCount()
-
getDurableScheduledSize
long getDurableScheduledSize()
-
getScheduledMessages
List<MessageReference> getScheduledMessages()
-
getDeliveringMessages
Map<String,List<MessageReference>> getDeliveringMessages()
Return a Map consisting of consumer.toString and its messages Delivering message is a property of the consumer, this method will aggregate the results per Server's consumer object- Returns:
-
getMessagesAdded
long getMessagesAdded()
-
getAcknowledgeAttempts
long getAcknowledgeAttempts()
-
getMessagesAcknowledged
long getMessagesAcknowledged()
-
getMessagesExpired
long getMessagesExpired()
-
getMessagesKilled
long getMessagesKilled()
-
getMessagesReplaced
long getMessagesReplaced()
-
removeReferenceWithID
MessageReference removeReferenceWithID(long id) throws Exception
- Throws:
Exception
-
getReference
MessageReference getReference(long id) throws ActiveMQException
- Throws:
ActiveMQException
-
deleteMatchingReferences
int deleteMatchingReferences(Filter filter) throws Exception
- Throws:
Exception
-
deleteMatchingReferences
default int deleteMatchingReferences(int flushLImit, Filter filter) throws Exception- Throws:
Exception
-
deleteMatchingReferences
int deleteMatchingReferences(int flushLImit, Filter filter, AckReason ackReason) throws Exception- Throws:
Exception
-
expireReferences
int expireReferences(Filter filter) throws Exception
Expire all the references in the queue which matches the filter- Throws:
Exception
-
expireReferences
default void expireReferences()
-
expireReferences
void expireReferences(Runnable done)
-
expire
void expire(MessageReference ref) throws Exception
- Throws:
Exception
-
expire
void expire(MessageReference ref, ServerConsumer consumer, boolean delivering) throws Exception
- Throws:
Exception
-
sendMessageToDeadLetterAddress
boolean sendMessageToDeadLetterAddress(long messageID) throws Exception- Throws:
Exception
-
sendMessagesToDeadLetterAddress
int sendMessagesToDeadLetterAddress(Filter filter) throws Exception
- Throws:
Exception
-
sendToDeadLetterAddress
boolean sendToDeadLetterAddress(Transaction tx, MessageReference ref) throws Exception
- Parameters:
tx-ref-- Returns:
- whether or not the message was actually sent to a DLA with bindings
- Throws:
Exception
-
changeReferencePriority
boolean changeReferencePriority(long messageID, byte newPriority) throws Exception- Throws:
Exception
-
changeReferencesPriority
int changeReferencesPriority(Filter filter, byte newPriority) throws Exception
- Throws:
Exception
-
moveReference
boolean moveReference(long messageID, SimpleString toAddress, Binding binding, boolean rejectDuplicates) throws Exception- Throws:
Exception
-
moveReferences
int moveReferences(Filter filter, SimpleString toAddress, Binding binding) throws Exception
- Throws:
Exception
-
moveReferences
int moveReferences(int flushLimit, Filter filter, SimpleString toAddress, boolean rejectDuplicates, Binding binding) throws Exception- Throws:
Exception
-
moveReferences
int moveReferences(int flushLimit, Filter filter, SimpleString toAddress, boolean rejectDuplicates, int messageCount, Binding binding) throws Exception- Throws:
Exception
-
retryMessages
default int retryMessages(Filter filter, Integer expectedHits) throws Exception
- Throws:
Exception
-
addRedistributor
void addRedistributor(long delay)
-
cancelRedistributor
void cancelRedistributor()
-
hasMatchingConsumer
boolean hasMatchingConsumer(Message message)
-
getConsumers
Collection<Consumer> getConsumers()
-
getGroups
Map<SimpleString,Consumer> getGroups()
-
resetGroup
void resetGroup(SimpleString groupID)
-
resetAllGroups
void resetAllGroups()
-
getGroupCount
int getGroupCount()
-
checkRedelivery
Pair<Boolean,Boolean> checkRedelivery(MessageReference ref, long timeBase, boolean ignoreRedeliveryDelay) throws Exception
- Parameters:
ref-timeBase-ignoreRedeliveryDelay-- Returns:
- a Pair of Booleans: the first indicates whether or not redelivery happened; the second indicates whether or not the message was actually sent to a DLA with bindings
- Throws:
Exception
-
iterator
LinkedListIterator<MessageReference> iterator()
It will iterate through memory only (not paging)- Returns:
-
forEach
default void forEach(Consumer<MessageReference> consumer)
-
peekFirstMessage
default MessageReference peekFirstMessage()
-
browserIterator
LinkedListIterator<MessageReference> browserIterator()
-
getExpiryAddress
SimpleString getExpiryAddress()
-
getDeadLetterAddress
SimpleString getDeadLetterAddress()
-
pause
void pause()
Pauses the queue. It will receive messages but won't give them to the consumers until resumed. If a queue is paused, pausing it again will only throw a warning. To check if a queue is paused, invoke isPaused()
-
pause
void pause(boolean persist)
Pauses the queue. It will receive messages but won't give them to the consumers until resumed. If a queue is paused, pausing it again will only throw a warning. To check if a queue is paused, invoke isPaused()
-
reloadPause
void reloadPause(long recordID)
-
resume
void resume()
Resumes the delivery of message for the queue. If a queue is resumed, resuming it again will only throw a warning. To check if a queue is resumed, invoke isPaused()
-
isPaused
boolean isPaused()
- Returns:
- true if paused, false otherwise.
-
isPersistedPause
boolean isPersistedPause()
if the pause was persisted- Returns:
-
getExecutor
Executor getExecutor()
-
resetAllIterators
void resetAllIterators()
-
flushExecutor
boolean flushExecutor()
-
isDirectDeliver
boolean isDirectDeliver()
-
getAddress
SimpleString getAddress()
-
isInternalQueue
boolean isInternalQueue()
We can't send stuff to DLQ on queues used on clustered-bridge-communication- Returns:
-
setInternalQueue
void setInternalQueue(boolean internalQueue)
-
resetMessagesAdded
void resetMessagesAdded()
-
resetMessagesAcknowledged
void resetMessagesAcknowledged()
-
resetMessagesExpired
void resetMessagesExpired()
-
resetMessagesKilled
void resetMessagesKilled()
-
incrementMesssagesAdded
void incrementMesssagesAdded()
-
deliverScheduledMessages
void deliverScheduledMessages() throws ActiveMQExceptioncancels scheduled messages and send them to the head of the queue.- Throws:
ActiveMQException
-
deliverScheduledMessages
void deliverScheduledMessages(String filter) throws ActiveMQException
cancels scheduled messages which match the filter and send them to the head of the queue.- Throws:
ActiveMQException
-
deliverScheduledMessage
void deliverScheduledMessage(long messageId) throws ActiveMQExceptioncancels scheduled message with the corresponding message ID and sends it to the head of the queue.- Throws:
ActiveMQException
-
postAcknowledge
void postAcknowledge(MessageReference ref, AckReason reason)
-
postAcknowledge
void postAcknowledge(MessageReference ref, AckReason reason, boolean delivering)
-
getUser
SimpleString getUser()
- Returns:
- the user associated with this queue
-
setUser
void setUser(SimpleString user)
- Parameters:
user- the user associated with this queue
-
recheckRefCount
void recheckRefCount(OperationContext context)
This is to perform a check on the counter again
-
errorProcessing
default void errorProcessing(Consumer consumer, Throwable t, MessageReference messageReference)
-
getQueueConfiguration
default QueueConfiguration getQueueConfiguration()
-
-