public class Queue extends BaseDestination implements org.apache.activemq.thread.Task, org.apache.activemq.usage.UsageListener, IndexListener
IndexListener.MessageContext
Modifier and Type | Field and Description |
---|---|
protected List<Subscription> |
consumers |
protected QueueDispatchPendingList |
dispatchPendingList |
protected static Logger |
LOG |
protected PendingMessageCursor |
messages |
protected org.apache.activemq.thread.TaskRunnerFactory |
taskFactory |
protected org.apache.activemq.thread.TaskRunner |
taskRunner |
blockedProducerWarningInterval, broker, brokerService, cursorMemoryHighWaterMark, deadLetterStrategy, DEFAULT_INACTIVE_TIMEOUT_BEFORE_GC, destination, destinationStatistics, DUPLICATE_FROM_STORE_MSG_PREFIX, EXPIRE_MESSAGE_PERIOD, expireMessagesPeriod, lastBlockedProducerWarnTime, MAX_AUDIT_DEPTH, MAX_BROWSE_PAGE_SIZE, MAX_PAGE_SIZE, MAX_PRODUCERS_TO_AUDIT, memoryUsage, regionBroker, scheduler, started, store, storeUsageHighWaterMark, systemUsage
DEFAULT_BLOCKED_PRODUCER_WARNING_INTERVAL, DEFAULT_DEAD_LETTER_STRATEGY
Constructor and Description |
---|
Queue(BrokerService brokerService,
org.apache.activemq.command.ActiveMQDestination destination,
MessageStore store,
DestinationStatistics parentStats,
org.apache.activemq.thread.TaskRunnerFactory taskFactory) |
Modifier and Type | Method and Description |
---|---|
void |
acknowledge(ConnectionContext context,
Subscription sub,
org.apache.activemq.command.MessageAck ack,
org.apache.activemq.broker.region.MessageReference node) |
void |
addSubscription(ConnectionContext context,
Subscription sub) |
protected void |
assignGroup(Subscription subs,
MessageGroupMap messageGroupOwners,
org.apache.activemq.broker.region.MessageReference n,
String groupId) |
protected boolean |
assignMessageGroup(Subscription subscription,
QueueMessageReference node) |
org.apache.activemq.command.Message[] |
browse() |
void |
clearPendingMessages(int pendingAdditionsCount) |
int |
copyMatchingMessages(ConnectionContext context,
MessageReferenceFilter filter,
org.apache.activemq.command.ActiveMQDestination dest,
int maximumMessages)
Copies the messages matching the given filter up to the maximum number of
matched messages
|
int |
copyMatchingMessagesTo(ConnectionContext context,
String selector,
org.apache.activemq.command.ActiveMQDestination dest)
Copies the messages matching the given selector
|
int |
copyMatchingMessagesTo(ConnectionContext context,
String selector,
org.apache.activemq.command.ActiveMQDestination dest,
int maximumMessages)
Copies the messages matching the given selector up to the maximum number
of matched messages
|
boolean |
copyMessageTo(ConnectionContext context,
String messageId,
org.apache.activemq.command.ActiveMQDestination dest)
Copies the message matching the given messageId
|
protected MessageReferenceFilter |
createMessageIdFilter(String messageId) |
protected MessageReferenceFilter |
createSelectorFilter(String selector) |
void |
doBrowse(List<org.apache.activemq.command.Message> browseList,
int max) |
protected void |
doBrowseList(List<org.apache.activemq.command.Message> browseList,
int max,
PendingList list,
ReentrantReadWriteLock lock,
ConnectionContext connectionContext,
String name) |
void |
gc() |
org.apache.activemq.command.ActiveMQDestination |
getActiveMQDestination() |
List<Subscription> |
getConsumers() |
int |
getConsumersBeforeDispatchStarts() |
DispatchPolicy |
getDispatchPolicy() |
protected Logger |
getLog() |
QueueMessageReference |
getMessage(String id) |
MessageGroupMapFactory |
getMessageGroupMapFactory() |
MessageGroupMap |
getMessageGroupOwners() |
PendingMessageCursor |
getMessages() |
long |
getPendingMessageCount() |
long |
getPendingMessageSize() |
int |
getTimeBeforeDispatchStarts() |
void |
initialize()
initialize the destination
|
boolean |
isAllConsumersExclusiveByDefault() |
boolean |
isDispatchPaused() |
boolean |
isOptimizedDispatch() |
protected boolean |
isOptimizeStorage() |
boolean |
isResetNeeded() |
boolean |
isStrictOrderDispatch() |
boolean |
isUseConsumerPriority() |
boolean |
iterate() |
void |
messageExpired(ConnectionContext context,
org.apache.activemq.broker.region.MessageReference reference) |
void |
messageExpired(ConnectionContext context,
Subscription subs,
org.apache.activemq.broker.region.MessageReference reference)
Inform the Destination a message has expired
|
int |
moveMatchingMessagesTo(ConnectionContext context,
MessageReferenceFilter filter,
org.apache.activemq.command.ActiveMQDestination dest,
int maximumMessages)
Moves the messages matching the given filter up to the maximum number of
matched messages
|
int |
moveMatchingMessagesTo(ConnectionContext context,
String selector,
org.apache.activemq.command.ActiveMQDestination dest)
Moves the messages matching the given selector
|
int |
moveMatchingMessagesTo(ConnectionContext context,
String selector,
org.apache.activemq.command.ActiveMQDestination dest,
int maximumMessages)
Moves the messages matching the given selector up to the maximum number
of matched messages
|
boolean |
moveMessageTo(ConnectionContext context,
QueueMessageReference m,
org.apache.activemq.command.ActiveMQDestination dest)
Move a message
|
boolean |
moveMessageTo(ConnectionContext context,
String messageId,
org.apache.activemq.command.ActiveMQDestination dest)
Moves the message matching the given messageId
|
void |
onAdd(IndexListener.MessageContext messageContext)
called with some global index lock held so that a listener can do order
dependent work
non null MessageContext.onCompletion called when work is done
|
void |
onUsageChanged(org.apache.activemq.usage.Usage usage,
int oldPercentUsage,
int newPercentUsage) |
protected void |
pageInMessages(boolean force,
int maxPageSize) |
void |
pauseDispatch() |
void |
processDispatchNotification(org.apache.activemq.command.MessageDispatchNotification messageDispatchNotification)
called on Queues in slave mode to allow dispatch to follow subscription
choice of master
|
void |
purge() |
int |
removeMatchingMessages(MessageReferenceFilter filter,
int maximumMessages)
Removes the messages matching the given filter up to the maximum number
of matched messages
|
int |
removeMatchingMessages(String selector)
Removes the messages matching the given selector
|
int |
removeMatchingMessages(String selector,
int maximumMessages)
Removes the messages matching the given selector up to the maximum number
of matched messages
|
protected void |
removeMessage(ConnectionContext c,
QueueMessageReference r) |
protected void |
removeMessage(ConnectionContext c,
Subscription subs,
QueueMessageReference r) |
protected void |
removeMessage(ConnectionContext context,
Subscription sub,
QueueMessageReference reference,
org.apache.activemq.command.MessageAck ack) |
boolean |
removeMessage(String messageId)
Removes the message matching the given messageId
|
void |
removeSubscription(ConnectionContext context,
Subscription sub,
long lastDeliveredSequenceId) |
void |
resumeDispatch() |
int |
retryMessages(ConnectionContext context,
int maximumMessages) |
void |
rollbackPendingCursorAdditions(org.apache.activemq.command.MessageId messageId) |
void |
send(ProducerBrokerExchange producerExchange,
org.apache.activemq.command.Message message) |
void |
setAllConsumersExclusiveByDefault(boolean allConsumersExclusiveByDefault) |
void |
setConsumersBeforeDispatchStarts(int consumersBeforeDispatchStarts) |
void |
setDispatchPolicy(DispatchPolicy dispatchPolicy) |
void |
setMessageGroupMapFactory(MessageGroupMapFactory messageGroupMapFactory) |
void |
setMessages(PendingMessageCursor messages) |
void |
setOptimizedDispatch(boolean optimizedDispatch) |
void |
setPrioritizedMessages(boolean prioritizedMessages) |
void |
setStrictOrderDispatch(boolean strictOrderDispatch) |
void |
setTimeBeforeDispatchStarts(int timeBeforeDispatchStarts) |
void |
setUseConsumerPriority(boolean useConsumerPriority) |
boolean |
singlePendingSend() |
void |
start() |
void |
stop() |
String |
toString() |
void |
wakeup()
optionally called by a Subscriber - to inform the Destination its ready
for more messages
|
addProducer, canGC, convertToNonRangedAck, createConnectionContext, dispose, duplicateFromStore, fastProducer, getBlockedProducerWarningInterval, getCursorMemoryHighWaterMark, getDeadLetterStrategy, getDestinationSequenceId, getDestinationStatistics, getExpireMessagesPeriod, getInactiveTimeoutBeforeGC, getMaxAuditDepth, getMaxBrowsePageSize, getMaxExpirePageSize, getMaxPageSize, getMaxProducersToAudit, getMemoryUsage, getMessageStore, getMinimumMessageSize, getName, getOptimizeMessageStoreInFlightLimit, getSlowConsumerStrategy, getStoreUsageHighWaterMark, getSystemUsage, getTempUsage, hasRegularConsumers, isActive, isAdvisoryForConsumed, isAdvisoryForDelivery, isAdvisoryForDiscardingMessages, isAdvisoryForFastProducers, isAdvisoryForSlowConsumers, isAdvisoryWhenFull, isAlwaysRetroactive, isDisposed, isDLQ, isDoOptimzeMessageStorage, isEnableAudit, isFlowControlLogRequired, isFull, isGcIfInactive, isGcWithNetworkConsumers, isIncludeBodyForAdvisory, isLazyDispatch, isPersistJMSRedelivered, isPrioritizedMessages, isProducerFlowControl, isReduceMemoryFootprint, isSendAdvisoryIfNoConsumers, isUseCache, markForGC, messageConsumed, messageDelivered, messageDiscarded, onMessageWithNoConsumers, removeProducer, setAdvisoryForConsumed, setAdvisoryForDelivery, setAdvisoryForDiscardingMessages, setAdvisoryForFastProducers, setAdvisoryForSlowConsumers, setAdvisoryWhenFull, setAlwaysRetroactive, setBlockedProducerWarningInterval, setCursorMemoryHighWaterMark, setDeadLetterStrategy, setDoOptimzeMessageStorage, setEnableAudit, setExpireMessagesPeriod, setGcIfInactive, setGcWithNetworkConsumers, setInactiveTimeoutBeforeGC, setIncludeBodyForAdvisory, setLazyDispatch, setMaxAuditDepth, setMaxBrowsePageSize, setMaxExpirePageSize, setMaxPageSize, setMaxProducersToAudit, setMemoryUsage, setMinimumMessageSize, setOptimizeMessageStoreInFlightLimit, setPersistJMSRedelivered, setProducerFlowControl, setReduceMemoryFootprint, setSendAdvisoryIfNoConsumers, setSlowConsumerStrategy, setStoreUsageHighWaterMark, setUseCache, slowConsumer, waitForSpace, waitForSpace
protected final org.apache.activemq.thread.TaskRunnerFactory taskFactory
protected org.apache.activemq.thread.TaskRunner taskRunner
protected final List<Subscription> consumers
protected PendingMessageCursor messages
protected QueueDispatchPendingList dispatchPendingList
public Queue(BrokerService brokerService, org.apache.activemq.command.ActiveMQDestination destination, MessageStore store, DestinationStatistics parentStats, org.apache.activemq.thread.TaskRunnerFactory taskFactory) throws Exception
Exception
public boolean singlePendingSend()
public List<Subscription> getConsumers()
getConsumers
in interface Destination
getConsumers
in class BaseDestination
public void setPrioritizedMessages(boolean prioritizedMessages)
setPrioritizedMessages
in class BaseDestination
public void initialize() throws Exception
BaseDestination
initialize
in class BaseDestination
Exception
public void addSubscription(ConnectionContext context, Subscription sub) throws Exception
addSubscription
in interface Destination
addSubscription
in class BaseDestination
Exception
public void removeSubscription(ConnectionContext context, Subscription sub, long lastDeliveredSequenceId) throws Exception
removeSubscription
in interface Destination
removeSubscription
in class BaseDestination
Exception
public void send(ProducerBrokerExchange producerExchange, org.apache.activemq.command.Message message) throws Exception
send
in interface Destination
Exception
public void onAdd(IndexListener.MessageContext messageContext)
IndexListener
onAdd
in interface IndexListener
public void rollbackPendingCursorAdditions(org.apache.activemq.command.MessageId messageId)
public void gc()
gc
in interface Destination
public void acknowledge(ConnectionContext context, Subscription sub, org.apache.activemq.command.MessageAck ack, org.apache.activemq.broker.region.MessageReference node) throws IOException
acknowledge
in interface Destination
IOException
public long getPendingMessageSize()
public long getPendingMessageCount()
public void start() throws Exception
start
in interface org.apache.activemq.Service
Exception
public void stop() throws Exception
stop
in interface org.apache.activemq.Service
Exception
public org.apache.activemq.command.ActiveMQDestination getActiveMQDestination()
getActiveMQDestination
in interface Destination
getActiveMQDestination
in class BaseDestination
public MessageGroupMap getMessageGroupOwners()
public DispatchPolicy getDispatchPolicy()
public void setDispatchPolicy(DispatchPolicy dispatchPolicy)
public MessageGroupMapFactory getMessageGroupMapFactory()
public void setMessageGroupMapFactory(MessageGroupMapFactory messageGroupMapFactory)
public PendingMessageCursor getMessages()
public void setMessages(PendingMessageCursor messages)
public boolean isUseConsumerPriority()
public void setUseConsumerPriority(boolean useConsumerPriority)
public boolean isStrictOrderDispatch()
public void setStrictOrderDispatch(boolean strictOrderDispatch)
public boolean isOptimizedDispatch()
public void setOptimizedDispatch(boolean optimizedDispatch)
public int getTimeBeforeDispatchStarts()
public void setTimeBeforeDispatchStarts(int timeBeforeDispatchStarts)
public int getConsumersBeforeDispatchStarts()
public void setConsumersBeforeDispatchStarts(int consumersBeforeDispatchStarts)
public void setAllConsumersExclusiveByDefault(boolean allConsumersExclusiveByDefault)
public boolean isAllConsumersExclusiveByDefault()
public boolean isResetNeeded()
public org.apache.activemq.command.Message[] browse()
browse
in interface Destination
protected void doBrowseList(List<org.apache.activemq.command.Message> browseList, int max, PendingList list, ReentrantReadWriteLock lock, ConnectionContext connectionContext, String name) throws Exception
Exception
public QueueMessageReference getMessage(String id)
public void clearPendingMessages(int pendingAdditionsCount)
clearPendingMessages
in interface Destination
public boolean removeMessage(String messageId) throws Exception
Exception
public int removeMatchingMessages(String selector) throws Exception
Exception
public int removeMatchingMessages(String selector, int maximumMessages) throws Exception
Exception
public int removeMatchingMessages(MessageReferenceFilter filter, int maximumMessages) throws Exception
Exception
public boolean copyMessageTo(ConnectionContext context, String messageId, org.apache.activemq.command.ActiveMQDestination dest) throws Exception
Exception
public int copyMatchingMessagesTo(ConnectionContext context, String selector, org.apache.activemq.command.ActiveMQDestination dest) throws Exception
Exception
public int copyMatchingMessagesTo(ConnectionContext context, String selector, org.apache.activemq.command.ActiveMQDestination dest, int maximumMessages) throws Exception
Exception
public int copyMatchingMessages(ConnectionContext context, MessageReferenceFilter filter, org.apache.activemq.command.ActiveMQDestination dest, int maximumMessages) throws Exception
Exception
public boolean moveMessageTo(ConnectionContext context, QueueMessageReference m, org.apache.activemq.command.ActiveMQDestination dest) throws Exception
context
- connection contextm
- QueueMessageReferencedest
- ActiveMQDestinationException
public boolean moveMessageTo(ConnectionContext context, String messageId, org.apache.activemq.command.ActiveMQDestination dest) throws Exception
Exception
public int moveMatchingMessagesTo(ConnectionContext context, String selector, org.apache.activemq.command.ActiveMQDestination dest) throws Exception
Exception
public int moveMatchingMessagesTo(ConnectionContext context, String selector, org.apache.activemq.command.ActiveMQDestination dest, int maximumMessages) throws Exception
Exception
public int moveMatchingMessagesTo(ConnectionContext context, MessageReferenceFilter filter, org.apache.activemq.command.ActiveMQDestination dest, int maximumMessages) throws Exception
Exception
public int retryMessages(ConnectionContext context, int maximumMessages) throws Exception
Exception
public boolean iterate()
iterate
in interface org.apache.activemq.thread.Task
Task.iterate()
public void pauseDispatch()
public void resumeDispatch()
public boolean isDispatchPaused()
protected MessageReferenceFilter createMessageIdFilter(String messageId)
protected MessageReferenceFilter createSelectorFilter(String selector) throws javax.jms.InvalidSelectorException
javax.jms.InvalidSelectorException
protected void removeMessage(ConnectionContext c, QueueMessageReference r) throws IOException
IOException
protected void removeMessage(ConnectionContext c, Subscription subs, QueueMessageReference r) throws IOException
IOException
protected void removeMessage(ConnectionContext context, Subscription sub, QueueMessageReference reference, org.apache.activemq.command.MessageAck ack) throws IOException
IOException
public void messageExpired(ConnectionContext context, org.apache.activemq.broker.region.MessageReference reference)
public void messageExpired(ConnectionContext context, Subscription subs, org.apache.activemq.broker.region.MessageReference reference)
Destination
messageExpired
in interface Destination
public void wakeup()
Destination
wakeup
in interface Destination
protected boolean assignMessageGroup(Subscription subscription, QueueMessageReference node) throws Exception
Exception
protected void assignGroup(Subscription subs, MessageGroupMap messageGroupOwners, org.apache.activemq.broker.region.MessageReference n, String groupId) throws IOException
IOException
protected void pageInMessages(boolean force, int maxPageSize) throws Exception
Exception
public void processDispatchNotification(org.apache.activemq.command.MessageDispatchNotification messageDispatchNotification) throws Exception
Destination
processDispatchNotification
in interface Destination
processDispatchNotification
in class BaseDestination
Exception
public void onUsageChanged(org.apache.activemq.usage.Usage usage, int oldPercentUsage, int newPercentUsage)
onUsageChanged
in interface org.apache.activemq.usage.UsageListener
protected Logger getLog()
getLog
in class BaseDestination
protected boolean isOptimizeStorage()
Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.