Interface Queue
- All Superinterfaces:
Bindable,CriticalComponent
- All Known Implementing Classes:
LastValueQueue,QueueImpl
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidacknowledge(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) Called when a message is cancelled back into the queuevoidaddSorted(MessageReference ref, boolean scheduling) Called when a message is cancelled back into the queuevoidaddTail(MessageReference ref) voidaddTail(MessageReference ref, boolean direct) booleanthe current queue and consumer settings will allow use of the Reference Execution and callback.voidcancel(MessageReference reference, long timeBase) voidcancel(Transaction tx, MessageReference ref) voidcancel(Transaction tx, MessageReference ref, boolean ignoreRedeliveryCheck) voidbooleanchangeReferencePriority(long messageID, byte newPriority) intchangeReferencesPriority(Filter filter, byte newPriority) checkRedelivery(MessageReference ref, long timeBase, boolean ignoreRedeliveryDelay) Returns a Pair of Booleans: the first indicates whether redelivery happened; the second indicates whether or not the message was actually sent to a DLA with bindings.voidclose()booleancopyReference(long messageID, SimpleString queue, Binding binding) intintdeleteAllReferences(int flushLimit) default intdeleteMatchingReferences(int flushLImit, Filter filter) intdeleteMatchingReferences(int flushLImit, Filter filter, AckReason ackReason) intdeleteMatchingReferences(Filter filter) voidvoiddeleteQueue(boolean removeConsumers) booleandeleteReference(long messageID) voidvoiddeliverScheduledMessage(long messageId) cancels scheduled message with the corresponding message ID and sends it to the head of the queue.voidcancels 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.voidintdurableDown(Message message) intdefault voiderrorProcessing(Consumer consumer, Throwable t, MessageReference messageReference) voidexpire(MessageReference ref) voidexpire(MessageReference ref, ServerConsumer consumer, boolean delivering) booleanexpireReference(long messageID) default voidvoidexpireReferences(Runnable done) intexpireReferences(Filter filter) Expire all the references in the queue which matches the filterbooleandefault voidflushOnIntermediate(Runnable runnable) voidThis method will make sure that any pending message (including paged message) will be delivereddefault voidforEach(Consumer<MessageReference> consumer) longlonglongintlongintThis will hold a reference counter for every consumer present on the queue.default longlongintReturn a Map consisting of consumer.toString and its messages.longlongintlonglongThis is the number of the durable messages in the queuelongThis is the persistent size of all the durable messages in the queueintlongintintgetID()intintlonglonglonglonglonglonggetName()longlongThis 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 consumeddefault QueueConfigurationlongintlonggetUser()booleanhasMatchingConsumer(Message message) voidbooleanbooleanbooleanbooleanbooleanbooleanbooleanThe queue definition could be durable, but the messages could eventually be considered non durable.booleanbooleanbooleanbooleanbooleanWe can't send stuff to DLQ on queues used on clustered-bridge-communicationbooleandefault booleanbooleanbooleanisPaused()booleanbooleandefault booleanisSwept()booleaniterator()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 MessageReferencedefault MessageReferencevoidpostAcknowledge(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) voidvoidrefUp(MessageReference messageReference) voidreload(MessageReference ref) voidreloadPause(long recordID) voidvoidThis method will push a removeAddress call into server's remove addressvoidremoveConsumer(Consumer consumer) voidremoveLingerSession(String sessionId) removeReferenceWithID(long id) removeWithSuppliedID(String serverID, long id, NodeStoreFactory<MessageReference> nodeStore) Remove item with a supplied non-negative (>= 0) ID.voidvoidvoidresetGroup(SimpleString groupID) voidvoidvoidvoidvoidresume()Resumes the delivery of message for the queue.intretryMessages(Filter filter) default intretryMessages(Filter filter, Integer expectedHits) intbooleansendMessageToDeadLetterAddress(long messageID) booleanReturns whether the message was actually sent to a DLA with bindings.voidsetConfigurationManaged(boolean configurationManaged) voidsetConsumersBeforeDispatch(int consumersBeforeDispatch) voidsetDelayBeforeDispatch(long delayBeforeDispatch) voidsetDispatching(boolean dispatching) voidsetEnabled(boolean value) voidsetExclusive(boolean value) voidvoidsetGroupBuckets(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, routeWithAckMethods inherited from interface org.apache.activemq.artemis.utils.critical.CriticalComponent
checkExpiration, getCriticalAnalyzer, measureCritical
-
Field Details
-
MAX_CONSUMERS_UNLIMITED
static final int MAX_CONSUMERS_UNLIMITED- See Also:
-
-
Method Details
-
getName
SimpleString getName() -
getID
Long getID() -
getFilter
Filter getFilter() -
setFilter
-
getPagingStore
PagingStore getPagingStore() -
getPageSubscription
PageSubscription getPageSubscription() -
getRoutingType
RoutingType getRoutingType() -
setRoutingType
-
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
-
durableDown
-
refUp
-
refDown
-
removeWithSuppliedID
MessageReference removeWithSuppliedID(String serverID, long id, NodeStoreFactory<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:
-
isDurableMessage
boolean isDurableMessage()The queue definition could be durable, but the messages could eventually be considered non durable. (e.g. purgeOnNoConsumers) -
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
-
isConfigurationManaged
boolean isConfigurationManaged() -
setConfigurationManaged
void setConfigurationManaged(boolean configurationManaged) -
addConsumer
- Throws:
Exception
-
addLingerSession
-
removeLingerSession
-
removeConsumer
-
getConsumerCount
int getConsumerCount() -
getConsumerRemovedTimestamp
long getConsumerRemovedTimestamp() -
setRingSize
void setRingSize(long ringSize) -
getRingSize
long getRingSize() -
getInitialQueueBufferSize
int getInitialQueueBufferSize() -
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
Called when a message is cancelled back into the queue -
reload
-
reloadSequence
-
flushOnIntermediate
-
addTail
-
addTail
-
addHead
-
addSorted
Called when a message is cancelled back into the queue -
addHead
-
acknowledge
- Throws:
Exception
-
acknowledge
- Throws:
Exception
-
acknowledge
- Throws:
Exception
-
acknowledge
- Throws:
Exception
-
acknowledge
void acknowledge(Transaction tx, MessageReference ref, AckReason reason, ServerConsumer consumer, boolean delivering) throws Exception - Throws:
Exception
-
reacknowledge
- Throws:
Exception
-
cancel
-
cancel
-
cancel
- Throws:
Exception
-
deliverAsync
void deliverAsync() -
unproposed
-
forceDelivery
void forceDelivery()This method will make sure that any pending message (including paged message) will be delivered -
deleteQueue
- Throws:
Exception
-
deleteQueue
- Throws:
Exception
-
removeAddress
This method will push a removeAddress call into server's remove address- Throws:
Exception
-
destroyPaging
- 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 consumedNote 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
-
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. -
getMessagesAdded
long getMessagesAdded() -
getAcknowledgeAttempts
long getAcknowledgeAttempts() -
getMessagesAcknowledged
long getMessagesAcknowledged() -
getMessagesExpired
long getMessagesExpired() -
getMessagesKilled
long getMessagesKilled() -
getMessagesReplaced
long getMessagesReplaced() -
removeReferenceWithID
- Throws:
Exception
-
deleteAllReferences
- Throws:
Exception
-
deleteAllReferences
- Throws:
Exception
-
deleteReference
- Throws:
Exception
-
deleteMatchingReferences
- Throws:
Exception
-
deleteMatchingReferences
- Throws:
Exception
-
deleteMatchingReferences
- Throws:
Exception
-
expireReference
- Throws:
Exception
-
expireReferences
Expire all the references in the queue which matches the filter- Throws:
Exception
-
expireReferences
default void expireReferences() -
expireReferences
-
expire
- Throws:
Exception
-
expire
- Throws:
Exception
-
sendMessageToDeadLetterAddress
- Throws:
Exception
-
sendMessagesToDeadLetterAddress
- Throws:
Exception
-
sendToDeadLetterAddress
Returns whether the message was actually sent to a DLA with bindings.- Returns:
- whether the message was actually sent to a DLA with bindings
- Throws:
Exception
-
changeReferencePriority
- Throws:
Exception
-
changeReferencesPriority
- Throws:
Exception
-
moveReference
boolean moveReference(long messageID, SimpleString toAddress, Binding binding, boolean rejectDuplicates) throws Exception - Throws:
Exception
-
moveReferences
- 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
-
copyReference
- Throws:
Exception
-
retryMessages
- Throws:
Exception
-
retryMessages
- Throws:
Exception
-
addRedistributor
void addRedistributor(long delay) -
cancelRedistributor
void cancelRedistributor() -
hasMatchingConsumer
-
getPendingMessageCount
long getPendingMessageCount() -
getConsumers
Collection<Consumer> getConsumers() -
getGroups
Map<SimpleString,Consumer> getGroups() -
resetGroup
-
resetAllGroups
void resetAllGroups() -
getGroupCount
int getGroupCount() -
checkRedelivery
Pair<Boolean,Boolean> checkRedelivery(MessageReference ref, long timeBase, boolean ignoreRedeliveryDelay) throws Exception Returns a Pair of Booleans: the first indicates whether redelivery happened; the second indicates whether or not the message was actually sent to a DLA with bindings.- Returns:
- a Pair of Booleans: the first indicates whether 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) -
forEach
-
peekFirstMessage
-
peekFirstScheduledMessage
-
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, invokeisPaused(). -
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, invokeisPaused(). -
isPaused
boolean isPaused() -
isPersistedPause
boolean isPersistedPause() -
getExecutor
Executor getExecutor() -
resetAllIterators
void resetAllIterators() -
flushExecutor
boolean flushExecutor() -
close
- Throws:
Exception
-
isDirectDeliver
boolean isDirectDeliver() -
getAddress
SimpleString getAddress() -
isInternalQueue
boolean isInternalQueue()We can't send stuff to DLQ on queues used on clustered-bridge-communication -
setInternalQueue
void setInternalQueue(boolean internalQueue) -
resetMessagesAdded
void resetMessagesAdded() -
resetMessagesAcknowledged
void resetMessagesAcknowledged() -
resetMessagesExpired
void resetMessagesExpired() -
resetMessagesKilled
void resetMessagesKilled() -
incrementMesssagesAdded
void incrementMesssagesAdded() -
deliverScheduledMessages
cancels scheduled messages and send them to the head of the queue.- Throws:
ActiveMQException
-
deliverScheduledMessages
cancels scheduled messages which match the filter and send them to the head of the queue.- Throws:
ActiveMQException
-
deliverScheduledMessage
cancels scheduled message with the corresponding message ID and sends it to the head of the queue.- Throws:
ActiveMQException
-
postAcknowledge
-
postAcknowledge
-
getUser
SimpleString getUser() -
setUser
-
recheckRefCount
This is to perform a check on the counter again -
errorProcessing
-
getQueueConfiguration
-
getCreatedTimestamp
default long getCreatedTimestamp()
-