public class Queue extends BaseDestination implements Task, UsageListener
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<Subscription> |
consumers |
protected static org.slf4j.Logger |
LOG |
protected PendingMessageCursor |
messages |
protected PendingList |
pagedInPendingDispatch |
protected PendingList |
redeliveredWaitingDispatch |
protected TaskRunnerFactory |
taskFactory |
protected TaskRunner |
taskRunner |
blockedProducerWarningInterval, broker, brokerService, cursorMemoryHighWaterMark, deadLetterStrategy, DEFAULT_INACTIVE_TIMEOUT_BEFORE_GC, destination, destinationStatistics, EXPIRE_MESSAGE_PERIOD, expireMessagesPeriod, MAX_AUDIT_DEPTH, MAX_BROWSE_PAGE_SIZE, MAX_PAGE_SIZE, MAX_PRODUCERS_TO_AUDIT, memoryUsage, regionBroker, scheduler, store, storeUsageHighWaterMark, systemUsage, warnOnProducerFlowControlDEFAULT_BLOCKED_PRODUCER_WARNING_INTERVAL, DEFAULT_DEAD_LETTER_STRATEGY| Constructor and Description |
|---|
Queue(BrokerService brokerService,
ActiveMQDestination destination,
MessageStore store,
DestinationStatistics parentStats,
TaskRunnerFactory taskFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge(ConnectionContext context,
Subscription sub,
MessageAck ack,
MessageReference node) |
void |
addSubscription(ConnectionContext context,
Subscription sub) |
protected void |
assignGroup(Subscription subs,
MessageGroupMap messageGroupOwners,
MessageReference n,
java.lang.String groupId) |
protected boolean |
assignMessageGroup(Subscription subscription,
QueueMessageReference node) |
Message[] |
browse() |
void |
clearPendingMessages() |
int |
copyMatchingMessages(ConnectionContext context,
MessageReferenceFilter filter,
ActiveMQDestination dest,
int maximumMessages)
Copies the messages matching the given filter up to the maximum number of
matched messages
|
int |
copyMatchingMessagesTo(ConnectionContext context,
java.lang.String selector,
ActiveMQDestination dest)
Copies the messages matching the given selector
|
int |
copyMatchingMessagesTo(ConnectionContext context,
java.lang.String selector,
ActiveMQDestination dest,
int maximumMessages)
Copies the messages matching the given selector up to the maximum number
of matched messages
|
boolean |
copyMessageTo(ConnectionContext context,
java.lang.String messageId,
ActiveMQDestination dest)
Copies the message matching the given messageId
|
protected MessageReferenceFilter |
createMessageIdFilter(java.lang.String messageId) |
protected MessageReferenceFilter |
createSelectorFilter(java.lang.String selector) |
void |
doBrowse(java.util.List<Message> browseList,
int max) |
void |
gc() |
ActiveMQDestination |
getActiveMQDestination() |
java.util.List<Subscription> |
getConsumers() |
int |
getConsumersBeforeDispatchStarts() |
DispatchPolicy |
getDispatchPolicy() |
protected org.slf4j.Logger |
getLog() |
QueueMessageReference |
getMessage(java.lang.String id) |
MessageGroupMapFactory |
getMessageGroupMapFactory() |
MessageGroupMap |
getMessageGroupOwners() |
PendingMessageCursor |
getMessages() |
int |
getTimeBeforeDispatchStarts() |
void |
initialize()
initialize the destination
|
boolean |
isAllConsumersExclusiveByDefault() |
boolean |
isOptimizedDispatch() |
protected boolean |
isOptimizeStorage() |
boolean |
isResetNeeded() |
boolean |
isStrictOrderDispatch() |
boolean |
isUseConsumerPriority() |
boolean |
iterate() |
void |
messageExpired(ConnectionContext context,
MessageReference reference) |
void |
messageExpired(ConnectionContext context,
Subscription subs,
MessageReference reference)
Inform the Destination a message has expired
|
int |
moveMatchingMessagesTo(ConnectionContext context,
MessageReferenceFilter filter,
ActiveMQDestination dest,
int maximumMessages)
Moves the messages matching the given filter up to the maximum number of
matched messages
|
int |
moveMatchingMessagesTo(ConnectionContext context,
java.lang.String selector,
ActiveMQDestination dest)
Moves the messages matching the given selector
|
int |
moveMatchingMessagesTo(ConnectionContext context,
java.lang.String selector,
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,
ActiveMQDestination dest)
Move a message
|
boolean |
moveMessageTo(ConnectionContext context,
java.lang.String messageId,
ActiveMQDestination dest)
Moves the message matching the given messageId
|
void |
onUsageChanged(Usage usage,
int oldPercentUsage,
int newPercentUsage) |
protected void |
pageInMessages(boolean force) |
void |
processDispatchNotification(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(java.lang.String selector)
Removes the messages matching the given selector
|
int |
removeMatchingMessages(java.lang.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,
MessageAck ack) |
boolean |
removeMessage(java.lang.String messageId)
Removes the message matching the given messageId
|
void |
removeSubscription(ConnectionContext context,
Subscription sub,
long lastDeiveredSequenceId) |
int |
retryMessages(ConnectionContext context,
int maximumMessages) |
void |
send(ProducerBrokerExchange producerExchange,
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) |
void |
start() |
void |
stop() |
java.lang.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, getInactiveTimoutBeforeGC, getMaxAuditDepth, getMaxBrowsePageSize, getMaxExpirePageSize, getMaxPageSize, getMaxProducersToAudit, getMemoryUsage, getMessageStore, getMinimumMessageSize, getName, getOptimizeMessageStoreInFlightLimit, getSlowConsumerStrategy, getStoreUsageHighWaterMark, hasRegularConsumers, isActive, isAdvisoryForConsumed, isAdvisoryForDelivery, isAdvisoryForDiscardingMessages, isAdvisoryForFastProducers, isAdvisoryForSlowConsumers, isAdvisoryWhenFull, isAlwaysRetroactive, isDisposed, isDLQ, isDoOptimzeMessageStorage, isEnableAudit, isFull, isGcIfInactive, isGcWithNetworkConsumers, isLazyDispatch, 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, setInactiveTimoutBeforeGC, setLazyDispatch, setMaxAuditDepth, setMaxBrowsePageSize, setMaxExpirePageSize, setMaxPageSize, setMaxProducersToAudit, setMemoryUsage, setMinimumMessageSize, setOptimizeMessageStoreInFlightLimit, setProducerFlowControl, setReduceMemoryFootprint, setSendAdvisoryIfNoConsumers, setSlowConsumerStrategy, setStoreUsageHighWaterMark, setUseCache, slowConsumer, waitForSpace, waitForSpaceprotected static final org.slf4j.Logger LOG
protected final TaskRunnerFactory taskFactory
protected TaskRunner taskRunner
protected final java.util.List<Subscription> consumers
protected PendingMessageCursor messages
protected PendingList pagedInPendingDispatch
protected PendingList redeliveredWaitingDispatch
public Queue(BrokerService brokerService, ActiveMQDestination destination, MessageStore store, DestinationStatistics parentStats, TaskRunnerFactory taskFactory) throws java.lang.Exception
java.lang.Exceptionpublic java.util.List<Subscription> getConsumers()
getConsumers in interface DestinationgetConsumers in class BaseDestinationpublic void setPrioritizedMessages(boolean prioritizedMessages)
setPrioritizedMessages in class BaseDestinationpublic void initialize()
throws java.lang.Exception
BaseDestinationinitialize in class BaseDestinationjava.lang.Exceptionpublic void addSubscription(ConnectionContext context, Subscription sub) throws java.lang.Exception
addSubscription in interface DestinationaddSubscription in class BaseDestinationjava.lang.Exceptionpublic void removeSubscription(ConnectionContext context, Subscription sub, long lastDeiveredSequenceId) throws java.lang.Exception
removeSubscription in interface DestinationremoveSubscription in class BaseDestinationjava.lang.Exceptionpublic void send(ProducerBrokerExchange producerExchange, Message message) throws java.lang.Exception
send in interface Destinationjava.lang.Exceptionpublic void gc()
gc in interface Destinationpublic void acknowledge(ConnectionContext context, Subscription sub, MessageAck ack, MessageReference node) throws java.io.IOException
acknowledge in interface Destinationjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic void start()
throws java.lang.Exception
public void stop()
throws java.lang.Exception
public ActiveMQDestination getActiveMQDestination()
getActiveMQDestination in interface DestinationgetActiveMQDestination in class BaseDestinationpublic 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 Message[] browse()
browse in interface Destinationpublic void doBrowse(java.util.List<Message> browseList, int max)
public QueueMessageReference getMessage(java.lang.String id)
public void purge()
throws java.lang.Exception
java.lang.Exceptionpublic void clearPendingMessages()
clearPendingMessages in interface Destinationpublic boolean removeMessage(java.lang.String messageId)
throws java.lang.Exception
java.lang.Exceptionpublic int removeMatchingMessages(java.lang.String selector)
throws java.lang.Exception
java.lang.Exceptionpublic int removeMatchingMessages(java.lang.String selector,
int maximumMessages)
throws java.lang.Exception
java.lang.Exceptionpublic int removeMatchingMessages(MessageReferenceFilter filter, int maximumMessages) throws java.lang.Exception
java.lang.Exceptionpublic boolean copyMessageTo(ConnectionContext context, java.lang.String messageId, ActiveMQDestination dest) throws java.lang.Exception
java.lang.Exceptionpublic int copyMatchingMessagesTo(ConnectionContext context, java.lang.String selector, ActiveMQDestination dest) throws java.lang.Exception
java.lang.Exceptionpublic int copyMatchingMessagesTo(ConnectionContext context, java.lang.String selector, ActiveMQDestination dest, int maximumMessages) throws java.lang.Exception
java.lang.Exceptionpublic int copyMatchingMessages(ConnectionContext context, MessageReferenceFilter filter, ActiveMQDestination dest, int maximumMessages) throws java.lang.Exception
java.lang.Exceptionpublic boolean moveMessageTo(ConnectionContext context, QueueMessageReference m, ActiveMQDestination dest) throws java.lang.Exception
context - connection contextm - QueueMessageReferencedest - ActiveMQDestinationjava.lang.Exceptionpublic boolean moveMessageTo(ConnectionContext context, java.lang.String messageId, ActiveMQDestination dest) throws java.lang.Exception
java.lang.Exceptionpublic int moveMatchingMessagesTo(ConnectionContext context, java.lang.String selector, ActiveMQDestination dest) throws java.lang.Exception
java.lang.Exceptionpublic int moveMatchingMessagesTo(ConnectionContext context, java.lang.String selector, ActiveMQDestination dest, int maximumMessages) throws java.lang.Exception
java.lang.Exceptionpublic int moveMatchingMessagesTo(ConnectionContext context, MessageReferenceFilter filter, ActiveMQDestination dest, int maximumMessages) throws java.lang.Exception
java.lang.Exceptionpublic int retryMessages(ConnectionContext context, int maximumMessages) throws java.lang.Exception
java.lang.Exceptionpublic boolean iterate()
iterate in interface TaskTask.iterate()protected MessageReferenceFilter createMessageIdFilter(java.lang.String messageId)
protected MessageReferenceFilter createSelectorFilter(java.lang.String selector) throws javax.jms.InvalidSelectorException
javax.jms.InvalidSelectorExceptionprotected void removeMessage(ConnectionContext c, QueueMessageReference r) throws java.io.IOException
java.io.IOExceptionprotected void removeMessage(ConnectionContext c, Subscription subs, QueueMessageReference r) throws java.io.IOException
java.io.IOExceptionprotected void removeMessage(ConnectionContext context, Subscription sub, QueueMessageReference reference, MessageAck ack) throws java.io.IOException
java.io.IOExceptionpublic void messageExpired(ConnectionContext context, MessageReference reference)
public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference)
DestinationmessageExpired in interface Destinationpublic void wakeup()
Destinationwakeup in interface Destinationprotected boolean assignMessageGroup(Subscription subscription, QueueMessageReference node) throws java.lang.Exception
java.lang.Exceptionprotected void assignGroup(Subscription subs, MessageGroupMap messageGroupOwners, MessageReference n, java.lang.String groupId) throws java.io.IOException
java.io.IOExceptionprotected void pageInMessages(boolean force)
throws java.lang.Exception
java.lang.Exceptionpublic void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws java.lang.Exception
DestinationprocessDispatchNotification in interface DestinationprocessDispatchNotification in class BaseDestinationjava.lang.Exceptionpublic void onUsageChanged(Usage usage, int oldPercentUsage, int newPercentUsage)
onUsageChanged in interface UsageListenerprotected org.slf4j.Logger getLog()
getLog in class BaseDestinationprotected boolean isOptimizeStorage()
Copyright © 2005-2014 Red Hat, Inc.. All Rights Reserved.