public class QueueImpl extends CriticalComponentImpl implements Queue
Completely non blocking between adding to queue and delivering to consumers.
| Modifier and Type | Field and Description |
|---|---|
static int |
CHECK_QUEUE_SIZE_PERIOD |
protected static int |
CRITICAL_CONSUMER |
protected static int |
CRITICAL_DELIVER |
protected static int |
CRITICAL_PATH_ADD_HEAD |
protected static int |
CRITICAL_PATH_ADD_TAIL |
protected static int |
CRITICAL_PATHS |
static int |
DEFAULT_FLUSH_LIMIT |
static int |
DELIVERY_TIMEOUT
If The system gets slow for any reason, this is the maximum time a Delivery or
or depage executor should be hanging on
|
static int |
MAX_DELIVERIES_IN_LOOP |
static int |
NUM_PRIORITIES |
static int |
REDISTRIBUTOR_BATCH_SIZE |
MAX_CONSUMERS_UNLIMITED| Constructor and Description |
|---|
QueueImpl(long id,
SimpleString address,
SimpleString name,
Filter filter,
PageSubscription pageSubscription,
SimpleString user,
boolean durable,
boolean temporary,
boolean autoCreated,
RoutingType routingType,
Integer maxConsumers,
Boolean exclusive,
Boolean purgeOnNoConsumers,
ScheduledExecutorService scheduledExecutor,
PostOffice postOffice,
StorageManager storageManager,
HierarchicalRepository<AddressSettings> addressSettingsRepository,
ArtemisExecutor executor,
ActiveMQServer server,
QueueFactory factory) |
QueueImpl(long id,
SimpleString address,
SimpleString name,
Filter filter,
PageSubscription pageSubscription,
SimpleString user,
boolean durable,
boolean temporary,
boolean autoCreated,
RoutingType routingType,
Integer maxConsumers,
Boolean purgeOnNoConsumers,
ScheduledExecutorService scheduledExecutor,
PostOffice postOffice,
StorageManager storageManager,
HierarchicalRepository<AddressSettings> addressSettingsRepository,
ArtemisExecutor executor,
ActiveMQServer server,
QueueFactory factory) |
QueueImpl(long id,
SimpleString address,
SimpleString name,
Filter filter,
PageSubscription pageSubscription,
SimpleString user,
boolean durable,
boolean temporary,
boolean autoCreated,
ScheduledExecutorService scheduledExecutor,
PostOffice postOffice,
StorageManager storageManager,
HierarchicalRepository<AddressSettings> addressSettingsRepository,
ArtemisExecutor executor,
ActiveMQServer server,
QueueFactory factory) |
QueueImpl(long id,
SimpleString address,
SimpleString name,
Filter filter,
SimpleString user,
boolean durable,
boolean temporary,
boolean autoCreated,
ScheduledExecutorService scheduledExecutor,
PostOffice postOffice,
StorageManager storageManager,
HierarchicalRepository<AddressSettings> addressSettingsRepository,
ArtemisExecutor executor,
ActiveMQServer server,
QueueFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge(MessageReference ref) |
void |
acknowledge(MessageReference ref,
AckReason reason,
ServerConsumer consumer) |
void |
acknowledge(MessageReference ref,
ServerConsumer consumer) |
void |
acknowledge(Transaction tx,
MessageReference ref) |
void |
acknowledge(Transaction tx,
MessageReference ref,
AckReason reason,
ServerConsumer consumer) |
void |
addConsumer(Consumer consumer) |
void |
addHead(List<MessageReference> refs,
boolean scheduling) |
void |
addHead(MessageReference ref,
boolean scheduling) |
void |
addRedistributor(long delay) |
void |
addTail(MessageReference ref) |
void |
addTail(MessageReference ref,
boolean direct) |
org.apache.activemq.artemis.core.server.impl.QueueImpl.QueueBrowserIterator |
browserIterator() |
void |
cancel(MessageReference reference,
long timeBase) |
void |
cancel(Transaction tx,
MessageReference reference) |
void |
cancel(Transaction tx,
MessageReference reference,
boolean ignoreRedeliveryCheck) |
void |
cancelRedistributor() |
boolean |
changeReferencePriority(long messageID,
byte newPriority) |
int |
changeReferencesPriority(Filter filter,
byte newPriority) |
boolean |
checkRedelivery(MessageReference reference,
long timeBase,
boolean ignoreRedeliveryDelay) |
void |
close() |
String |
debug() |
void |
decDelivering(MessageReference reference) |
int |
deleteAllReferences() |
int |
deleteAllReferences(int flushLimit) |
int |
deleteMatchingReferences(Filter filter) |
int |
deleteMatchingReferences(int flushLimit,
Filter filter1,
AckReason ackReason) |
void |
deleteQueue() |
void |
deleteQueue(boolean removeConsumers) |
boolean |
deleteReference(long messageID) |
void |
deliverAsync() |
void |
deliverNow() |
void |
deliverScheduledMessages()
cancels scheduled messages and send them to the head of the queue.
|
void |
destroyPaging() |
boolean |
equals(Object other) |
void |
expire(MessageReference ref) |
void |
expire(MessageReference ref,
ServerConsumer consumer) |
boolean |
expireReference(long messageID) |
void |
expireReferences() |
int |
expireReferences(Filter filter)
Expire all the references in the queue which matches the filter
|
protected void |
finalize() |
boolean |
flushExecutor() |
void |
forceDelivery()
This method will make sure that any pending message (including paged message) will be delivered
|
SimpleString |
getAddress() |
int |
getConsumerCount() |
Set<Consumer> |
getConsumers() |
ReferenceCounter |
getConsumersRefCount() |
int |
getDeliveringCount() |
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
|
long |
getDeliveringSize() |
int |
getDurableDeliveringCount() |
long |
getDurableDeliveringSize() |
long |
getDurableMessageCount()
This is the number of the durable messages in the queue
|
long |
getDurablePersistentSize()
This is the persistent size of all the durable messages in the queue
|
int |
getDurableScheduledCount() |
long |
getDurableScheduledSize() |
ArtemisExecutor |
getExecutor() |
SimpleString |
getExpiryAddress() |
Filter |
getFilter() |
int |
getGroupCount() |
Map<SimpleString,Consumer> |
getGroups() |
List<SimpleString> |
getGroupsUsed()
For testing only
|
long |
getID() |
int |
getMaxConsumers() |
long |
getMessageCount() |
long |
getMessagesAcknowledged() |
long |
getMessagesAdded() |
long |
getMessagesExpired() |
long |
getMessagesKilled() |
SimpleString |
getName() |
int |
getNumberOfReferences()
Used on testing only *
|
PageSubscription |
getPageSubscription() |
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
|
float |
getRate() |
MessageReference |
getReference(long id1) |
SimpleString |
getRoutingName() |
RoutingType |
getRoutingType() |
int |
getScheduledCount() |
List<MessageReference> |
getScheduledMessages() |
long |
getScheduledSize() |
SimpleString |
getUniqueName() |
SimpleString |
getUser() |
int |
hashCode() |
boolean |
hasMatchingConsumer(Message message) |
void |
incrementMesssagesAdded() |
boolean |
isAutoCreated() |
boolean |
isDirectDeliver() |
boolean |
isDurable() |
boolean |
isDurableMessage()
The queue definition could be durable, but the messages could eventually be considered non durable.
|
boolean |
isExclusive() |
boolean |
isExpirationRedundant() |
boolean |
isInternalQueue()
We can't send stuff to DLQ on queues used on clustered-bridge-communication
|
boolean |
isLastValue() |
boolean |
isPaused() |
boolean |
isPersistedPause()
if the pause was persisted
|
boolean |
isPurgeOnNoConsumers() |
boolean |
isTemporary() |
LinkedListIterator<MessageReference> |
iterator()
It will iterate thorugh memory only (not paging)
|
boolean |
moveReference(long messageID,
SimpleString toAddress,
Binding binding,
boolean rejectDuplicate) |
int |
moveReferences(Filter filter,
SimpleString toAddress,
Binding binding) |
int |
moveReferences(int flushLimit,
Filter filter,
SimpleString toAddress,
boolean rejectDuplicates,
Binding binding) |
int |
moveReferencesBetweenSnFQueues(SimpleString queueSuffix) |
void |
pause()
Pauses the queue.
|
void |
pause(boolean persist)
Pauses the queue.
|
void |
postAcknowledge(MessageReference ref) |
void |
reacknowledge(Transaction tx,
MessageReference ref) |
void |
recheckRefCount(OperationContext context)
This is to perform a check on the counter again
|
protected void |
refAdded(MessageReference ref) |
void |
referenceHandled(MessageReference ref) |
protected void |
refRemoved(MessageReference ref) |
void |
reload(MessageReference ref) |
void |
reloadPause(long recordID) |
void |
removeConsumer(Consumer consumer) |
MessageReference |
removeReferenceWithID(long id1) |
void |
resetAllGroups() |
void |
resetAllIterators() |
void |
resetGroup(SimpleString groupId) |
void |
resetMessagesAcknowledged() |
void |
resetMessagesAdded() |
void |
resetMessagesExpired() |
void |
resetMessagesKilled() |
void |
resume()
Resumes the delivery of message for the queue.
|
int |
retryMessages(Filter filter) |
void |
route(Message message,
RoutingContext context) |
void |
routeWithAck(Message message,
RoutingContext context) |
protected boolean |
scheduleIfPossible(MessageReference ref) |
int |
sendMessagesToDeadLetterAddress(Filter filter) |
boolean |
sendMessageToDeadLetterAddress(long messageID) |
void |
sendToDeadLetterAddress(Transaction tx,
MessageReference ref) |
void |
setConsumersRefCount(ReferenceCounter referenceCounter)
This will set a reference counter for every consumer present on the queue.
|
void |
setExclusive(boolean exclusive) |
void |
setInternalQueue(boolean internalQueue) |
void |
setMaxConsumer(int maxConsumers) |
void |
setPurgeOnNoConsumers(boolean value) |
void |
setRoutingType(RoutingType routingType) |
String |
toString() |
void |
unproposed(SimpleString groupID) |
enterCritical, getCriticalAnalyzer, isExpired, leaveCriticaldeleteMatchingReferencesenterCritical, isExpired, leaveCriticalprotected static final int CRITICAL_PATHS
protected static final int CRITICAL_PATH_ADD_TAIL
protected static final int CRITICAL_PATH_ADD_HEAD
protected static final int CRITICAL_DELIVER
protected static final int CRITICAL_CONSUMER
public static final int REDISTRIBUTOR_BATCH_SIZE
public static final int NUM_PRIORITIES
public static final int MAX_DELIVERIES_IN_LOOP
public static final int CHECK_QUEUE_SIZE_PERIOD
public static final int DELIVERY_TIMEOUT
public static final int DEFAULT_FLUSH_LIMIT
public QueueImpl(long id,
SimpleString address,
SimpleString name,
Filter filter,
SimpleString user,
boolean durable,
boolean temporary,
boolean autoCreated,
ScheduledExecutorService scheduledExecutor,
PostOffice postOffice,
StorageManager storageManager,
HierarchicalRepository<AddressSettings> addressSettingsRepository,
ArtemisExecutor executor,
ActiveMQServer server,
QueueFactory factory)
public QueueImpl(long id,
SimpleString address,
SimpleString name,
Filter filter,
PageSubscription pageSubscription,
SimpleString user,
boolean durable,
boolean temporary,
boolean autoCreated,
ScheduledExecutorService scheduledExecutor,
PostOffice postOffice,
StorageManager storageManager,
HierarchicalRepository<AddressSettings> addressSettingsRepository,
ArtemisExecutor executor,
ActiveMQServer server,
QueueFactory factory)
public QueueImpl(long id,
SimpleString address,
SimpleString name,
Filter filter,
PageSubscription pageSubscription,
SimpleString user,
boolean durable,
boolean temporary,
boolean autoCreated,
RoutingType routingType,
Integer maxConsumers,
Boolean purgeOnNoConsumers,
ScheduledExecutorService scheduledExecutor,
PostOffice postOffice,
StorageManager storageManager,
HierarchicalRepository<AddressSettings> addressSettingsRepository,
ArtemisExecutor executor,
ActiveMQServer server,
QueueFactory factory)
public QueueImpl(long id,
SimpleString address,
SimpleString name,
Filter filter,
PageSubscription pageSubscription,
SimpleString user,
boolean durable,
boolean temporary,
boolean autoCreated,
RoutingType routingType,
Integer maxConsumers,
Boolean exclusive,
Boolean purgeOnNoConsumers,
ScheduledExecutorService scheduledExecutor,
PostOffice postOffice,
StorageManager storageManager,
HierarchicalRepository<AddressSettings> addressSettingsRepository,
ArtemisExecutor executor,
ActiveMQServer server,
QueueFactory factory)
public List<SimpleString> getGroupsUsed()
public String debug()
public SimpleString getRoutingName()
public SimpleString getUniqueName()
public SimpleString getUser()
public boolean isExclusive()
isExclusive in interface Queuepublic void setExclusive(boolean exclusive)
setExclusive in interface Queuepublic boolean isLastValue()
isLastValue in interface Queuepublic void route(Message message, RoutingContext context) throws Exception
public void routeWithAck(Message message, RoutingContext context)
routeWithAck in interface Bindablepublic void setConsumersRefCount(ReferenceCounter referenceCounter)
QueuesetConsumersRefCount in interface Queuepublic ReferenceCounter getConsumersRefCount()
getConsumersRefCount in interface Queuepublic boolean isDurableMessage()
QueueisDurableMessage in interface Queuepublic boolean isTemporary()
isTemporary in interface Queuepublic boolean isAutoCreated()
isAutoCreated in interface Queuepublic boolean isPurgeOnNoConsumers()
isPurgeOnNoConsumers in interface Queuepublic void setPurgeOnNoConsumers(boolean value)
setPurgeOnNoConsumers in interface Queuepublic int getMaxConsumers()
getMaxConsumers in interface Queuepublic void setMaxConsumer(int maxConsumers)
setMaxConsumer in interface Queuepublic SimpleString getName()
public SimpleString getAddress()
getAddress in interface Queuepublic PageSubscription getPageSubscription()
getPageSubscription in interface Queuepublic RoutingType getRoutingType()
getRoutingType in interface Queuepublic void setRoutingType(RoutingType routingType)
setRoutingType in interface Queuepublic void unproposed(SimpleString groupID)
unproposed in interface Queuepublic void addHead(MessageReference ref, boolean scheduling)
public void addHead(List<MessageReference> refs, boolean scheduling)
public void reload(MessageReference ref)
public void addTail(MessageReference ref)
public void addTail(MessageReference ref, boolean direct)
protected boolean scheduleIfPossible(MessageReference ref)
public void forceDelivery()
QueueforceDelivery in interface Queuepublic void deliverAsync()
deliverAsync in interface Queuepublic ArtemisExecutor getExecutor()
getExecutor in interface Queuepublic void deliverNow()
public boolean flushExecutor()
flushExecutor in interface Queuepublic void addConsumer(Consumer consumer) throws Exception
addConsumer in interface QueueExceptionpublic void removeConsumer(Consumer consumer)
removeConsumer in interface Queuepublic void addRedistributor(long delay)
addRedistributor in interface Queuepublic void cancelRedistributor()
throws Exception
cancelRedistributor in interface QueueExceptionprotected void finalize()
throws Throwable
public int getConsumerCount()
getConsumerCount in interface Queuepublic Set<Consumer> getConsumers()
getConsumers in interface Queuepublic Map<SimpleString,Consumer> getGroups()
public void resetGroup(SimpleString groupId)
resetGroup in interface Queuepublic void resetAllGroups()
resetAllGroups in interface Queuepublic int getGroupCount()
getGroupCount in interface Queuepublic boolean hasMatchingConsumer(Message message)
hasMatchingConsumer in interface Queuepublic LinkedListIterator<MessageReference> iterator()
Queuepublic org.apache.activemq.artemis.core.server.impl.QueueImpl.QueueBrowserIterator browserIterator()
browserIterator in interface Queuepublic MessageReference removeReferenceWithID(long id1) throws Exception
removeReferenceWithID in interface QueueExceptionpublic MessageReference getReference(long id1) throws ActiveMQException
getReference in interface QueueActiveMQExceptionpublic long getMessageCount()
getMessageCount in interface Queuepublic long getPersistentSize()
QueuegetPersistentSize in interface Queuepublic long getDurableMessageCount()
QueuegetDurableMessageCount in interface Queuepublic long getDurablePersistentSize()
QueuegetDurablePersistentSize in interface Queuepublic int getScheduledCount()
getScheduledCount in interface Queuepublic long getScheduledSize()
getScheduledSize in interface Queuepublic int getDurableScheduledCount()
getDurableScheduledCount in interface Queuepublic long getDurableScheduledSize()
getDurableScheduledSize in interface Queuepublic List<MessageReference> getScheduledMessages()
getScheduledMessages in interface Queuepublic Map<String,List<MessageReference>> getDeliveringMessages()
QueuegetDeliveringMessages in interface Queuepublic int getDeliveringCount()
getDeliveringCount in interface Queuepublic long getDeliveringSize()
getDeliveringSize in interface Queuepublic int getDurableDeliveringCount()
getDurableDeliveringCount in interface Queuepublic long getDurableDeliveringSize()
getDurableDeliveringSize in interface Queuepublic void acknowledge(MessageReference ref) throws Exception
acknowledge in interface QueueExceptionpublic void acknowledge(MessageReference ref, ServerConsumer consumer) throws Exception
acknowledge in interface QueueExceptionpublic void acknowledge(MessageReference ref, AckReason reason, ServerConsumer consumer) throws Exception
acknowledge in interface QueueExceptionpublic void acknowledge(Transaction tx, MessageReference ref) throws Exception
acknowledge in interface QueueExceptionpublic void acknowledge(Transaction tx, MessageReference ref, AckReason reason, ServerConsumer consumer) throws Exception
acknowledge in interface QueueExceptionpublic void reacknowledge(Transaction tx, MessageReference ref) throws Exception
reacknowledge in interface QueueExceptionpublic void cancel(Transaction tx, MessageReference reference)
public void cancel(Transaction tx, MessageReference reference, boolean ignoreRedeliveryCheck)
public void cancel(MessageReference reference, long timeBase) throws Exception
public void expire(MessageReference ref) throws Exception
public void expire(MessageReference ref, ServerConsumer consumer) throws Exception
public SimpleString getExpiryAddress()
getExpiryAddress in interface Queuepublic void referenceHandled(MessageReference ref)
referenceHandled in interface Queuepublic void incrementMesssagesAdded()
incrementMesssagesAdded in interface Queuepublic void deliverScheduledMessages()
throws ActiveMQException
QueuedeliverScheduledMessages in interface QueueActiveMQExceptionpublic long getMessagesAdded()
getMessagesAdded in interface Queuepublic long getMessagesAcknowledged()
getMessagesAcknowledged in interface Queuepublic long getMessagesExpired()
getMessagesExpired in interface Queuepublic long getMessagesKilled()
getMessagesKilled in interface Queuepublic int deleteAllReferences()
throws Exception
deleteAllReferences in interface QueueExceptionpublic int deleteAllReferences(int flushLimit)
throws Exception
deleteAllReferences in interface QueueExceptionpublic int deleteMatchingReferences(Filter filter) throws Exception
deleteMatchingReferences in interface QueueExceptionpublic int deleteMatchingReferences(int flushLimit,
Filter filter1,
AckReason ackReason)
throws Exception
deleteMatchingReferences in interface QueueExceptionpublic void destroyPaging()
throws Exception
destroyPaging in interface QueueExceptionpublic boolean deleteReference(long messageID)
throws Exception
deleteReference in interface QueueExceptionpublic void deleteQueue()
throws Exception
deleteQueue in interface QueueExceptionpublic void deleteQueue(boolean removeConsumers)
throws Exception
deleteQueue in interface QueueExceptionpublic boolean expireReference(long messageID)
throws Exception
expireReference in interface QueueExceptionpublic int expireReferences(Filter filter) throws Exception
QueueexpireReferences in interface QueueExceptionpublic void expireReferences()
expireReferences in interface Queuepublic boolean isExpirationRedundant()
public boolean sendMessageToDeadLetterAddress(long messageID)
throws Exception
sendMessageToDeadLetterAddress in interface QueueExceptionpublic int sendMessagesToDeadLetterAddress(Filter filter) throws Exception
sendMessagesToDeadLetterAddress in interface QueueExceptionpublic boolean moveReference(long messageID,
SimpleString toAddress,
Binding binding,
boolean rejectDuplicate)
throws Exception
moveReference in interface QueueExceptionpublic int moveReferences(Filter filter, SimpleString toAddress, Binding binding) throws Exception
moveReferences in interface QueueExceptionpublic int moveReferences(int flushLimit,
Filter filter,
SimpleString toAddress,
boolean rejectDuplicates,
Binding binding)
throws Exception
moveReferences in interface QueueExceptionpublic int moveReferencesBetweenSnFQueues(SimpleString queueSuffix) throws Exception
Exceptionpublic int retryMessages(Filter filter) throws Exception
retryMessages in interface QueueExceptionpublic boolean changeReferencePriority(long messageID,
byte newPriority)
throws Exception
changeReferencePriority in interface QueueExceptionpublic int changeReferencesPriority(Filter filter, byte newPriority) throws Exception
changeReferencesPriority in interface QueueExceptionpublic void resetAllIterators()
resetAllIterators in interface Queuepublic void pause()
Queuepublic void reloadPause(long recordID)
reloadPause in interface Queuepublic void pause(boolean persist)
Queuepublic void resume()
Queuepublic boolean isPaused()
public boolean isPersistedPause()
QueueisPersistedPause in interface Queuepublic boolean isDirectDeliver()
isDirectDeliver in interface Queuepublic boolean isInternalQueue()
QueueisInternalQueue in interface Queuepublic void setInternalQueue(boolean internalQueue)
setInternalQueue in interface QueueinternalQueue - the internalQueue to setprotected void refRemoved(MessageReference ref)
protected void refAdded(MessageReference ref)
public boolean checkRedelivery(MessageReference reference, long timeBase, boolean ignoreRedeliveryDelay) throws Exception
checkRedelivery in interface QueueExceptionpublic int getNumberOfReferences()
public void sendToDeadLetterAddress(Transaction tx, MessageReference ref) throws Exception
sendToDeadLetterAddress in interface QueueExceptionpublic void postAcknowledge(MessageReference ref)
postAcknowledge in interface Queuepublic void resetMessagesAdded()
resetMessagesAdded in interface Queuepublic void resetMessagesAcknowledged()
resetMessagesAcknowledged in interface Queuepublic void resetMessagesExpired()
resetMessagesExpired in interface Queuepublic void resetMessagesKilled()
resetMessagesKilled in interface Queuepublic void recheckRefCount(OperationContext context)
QueuerecheckRefCount in interface Queuepublic void decDelivering(MessageReference reference)
Copyright © 2019 JBoss by Red Hat. All rights reserved.