Package org.apache.activemq.broker.jmx
Class QueueView
- java.lang.Object
-
- org.apache.activemq.broker.jmx.DestinationView
-
- org.apache.activemq.broker.jmx.QueueView
-
- All Implemented Interfaces:
DestinationViewMBean
,QueueViewMBean
public class QueueView extends DestinationView implements QueueViewMBean
Provides a JMX Management view of a Queue.
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.broker.jmx.DestinationView
broker, destination
-
-
Constructor Summary
Constructors Constructor Description QueueView(ManagedRegionBroker broker, Queue destination)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
copyMatchingMessagesTo(String selector, String destinationName)
Copies the messages matching the given selectorint
copyMatchingMessagesTo(String selector, String destinationName, int maximumMessages)
Copies the messages matching the given selector up to the maximum number of matched messagesboolean
copyMessageTo(String messageId, String destinationName)
Copies a given message to another destination.int
cursorSize()
boolean
doesCursorHaveMessagesBuffered()
boolean
doesCursorHaveSpace()
long
getCursorMemoryUsage()
int
getCursorPercentUsage()
CompositeData
getMessage(String messageId)
Retrieve a message from the destination's queue.Map<String,String>
getMessageGroups()
String
getMessageGroupType()
boolean
isCacheEnabled()
boolean
isCursorFull()
boolean
isPaused()
int
moveMatchingMessagesTo(String selector, String destinationName)
Moves the messages matching the given selectorint
moveMatchingMessagesTo(String selector, String destinationName, int maximumMessages)
Moves the messages matching the given selector up to the maximum number of matched messagesboolean
moveMessageTo(String messageId, String destinationName)
Moves the message to another destination.void
pause()
void
purge()
Removes all of the messages in the queue.void
removeAllMessageGroups()
remove all the message groups - will rebalance all message groups across consumersint
removeMatchingMessages(String selector)
Removes the messages matching the given selectorint
removeMatchingMessages(String selector, int maximumMessages)
Removes the messages matching the given selector up to the maximum number of matched messagesboolean
removeMessage(String messageId)
Removes a message from the queue.void
removeMessageGroup(String groupName)
remove a message group = has the effect of rebalancing groupvoid
resume()
boolean
retryMessage(String messageId)
Moves a message back to its original destinationint
retryMessages()
Retries messages sent to the DLQ-
Methods inherited from class org.apache.activemq.broker.jmx.DestinationView
browse, browse, browseAsTable, browseAsTable, browseMessages, browseMessages, gc, getAverageBlockedTime, getAverageEnqueueTime, getAverageMessageSize, getBlockedProducerWarningInterval, getBlockedSends, getConsumerCount, getDequeueCount, getDispatchCount, getDuplicateFromStoreCount, getEnqueueCount, getExpiredCount, getForwardCount, getInFlightCount, getMaxAuditDepth, getMaxEnqueueTime, getMaxMessageSize, getMaxPageSize, getMaxProducersToAudit, getMemoryLimit, getMemoryPercentUsage, getMemoryUsageByteCount, getMemoryUsagePortion, getMessagesCached, getMinEnqueueTime, getMinMessageSize, getName, getOptions, getProducerCount, getQueueSize, getSlowConsumerStrategy, getStoreMessageSize, getSubscriptions, getTempUsageLimit, getTempUsagePercentUsage, getTotalBlockedTime, isAlwaysRetroactive, isDLQ, isEnableAudit, isPrioritizedMessages, isProducerFlowControl, isSendDuplicateFromStoreToDLQ, isUseCache, resetStatistics, sendTextMessage, sendTextMessage, sendTextMessage, sendTextMessage, sendTextMessageWithProperties, sendTextMessageWithProperties, setAlwaysRetroactive, setBlockedProducerWarningInterval, setDLQ, setEnableAudit, setMaxAuditDepth, setMaxPageSize, setMaxProducersToAudit, setMemoryLimit, setMemoryUsagePortion, setProducerFlowControl, setTempUsageLimit, setUseCache
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.broker.jmx.DestinationViewMBean
browse, browse, browseAsTable, browseAsTable, browseMessages, browseMessages, getAverageBlockedTime, getAverageEnqueueTime, getAverageMessageSize, getBlockedProducerWarningInterval, getBlockedSends, getConsumerCount, getDequeueCount, getDispatchCount, getDuplicateFromStoreCount, getEnqueueCount, getExpiredCount, getForwardCount, getInFlightCount, getMaxAuditDepth, getMaxEnqueueTime, getMaxMessageSize, getMaxPageSize, getMaxProducersToAudit, getMemoryLimit, getMemoryPercentUsage, getMemoryUsageByteCount, getMemoryUsagePortion, getMinEnqueueTime, getMinMessageSize, getName, getOptions, getProducerCount, getQueueSize, getSlowConsumerStrategy, getStoreMessageSize, getSubscriptions, getTempUsageLimit, getTempUsagePercentUsage, getTotalBlockedTime, isAlwaysRetroactive, isDLQ, isPrioritizedMessages, isProducerFlowControl, isSendDuplicateFromStoreToDLQ, isUseCache, resetStatistics, sendTextMessage, sendTextMessage, sendTextMessage, sendTextMessage, sendTextMessageWithProperties, sendTextMessageWithProperties, setAlwaysRetroactive, setBlockedProducerWarningInterval, setDLQ, setMaxAuditDepth, setMaxPageSize, setMaxProducersToAudit, setMemoryLimit, setMemoryUsagePortion, setProducerFlowControl, setTempUsageLimit, setUseCache
-
-
-
-
Constructor Detail
-
QueueView
public QueueView(ManagedRegionBroker broker, Queue destination)
-
-
Method Detail
-
getMessage
public CompositeData getMessage(String messageId) throws OpenDataException
Description copied from interface:QueueViewMBean
Retrieve a message from the destination's queue.- Specified by:
getMessage
in interfaceQueueViewMBean
- Parameters:
messageId
- the message id of the message to retrieve- Returns:
- A CompositeData object which is a JMX version of the messages
- Throws:
OpenDataException
-
purge
public void purge() throws Exception
Description copied from interface:QueueViewMBean
Removes all of the messages in the queue.- Specified by:
purge
in interfaceQueueViewMBean
- Throws:
Exception
-
removeMessage
public boolean removeMessage(String messageId) throws Exception
Description copied from interface:QueueViewMBean
Removes a message from the queue. If the message has already been dispatched to another consumer, the message cannot be deleted and this method will return false.- Specified by:
removeMessage
in interfaceQueueViewMBean
- Returns:
- true if the message was found and could be successfully deleted.
- Throws:
Exception
-
removeMatchingMessages
public int removeMatchingMessages(String selector) throws Exception
Description copied from interface:QueueViewMBean
Removes the messages matching the given selector- Specified by:
removeMatchingMessages
in interfaceQueueViewMBean
- Returns:
- the number of messages removed
- Throws:
Exception
-
removeMatchingMessages
public int removeMatchingMessages(String selector, int maximumMessages) throws Exception
Description copied from interface:QueueViewMBean
Removes the messages matching the given selector up to the maximum number of matched messages- Specified by:
removeMatchingMessages
in interfaceQueueViewMBean
- Returns:
- the number of messages removed
- Throws:
Exception
-
copyMessageTo
public boolean copyMessageTo(String messageId, String destinationName) throws Exception
Description copied from interface:QueueViewMBean
Copies a given message to another destination.- Specified by:
copyMessageTo
in interfaceQueueViewMBean
- Returns:
- true if the message was found and was successfully copied to the other destination.
- Throws:
Exception
-
copyMatchingMessagesTo
public int copyMatchingMessagesTo(String selector, String destinationName) throws Exception
Description copied from interface:QueueViewMBean
Copies the messages matching the given selector- Specified by:
copyMatchingMessagesTo
in interfaceQueueViewMBean
- Returns:
- the number of messages copied
- Throws:
Exception
-
copyMatchingMessagesTo
public int copyMatchingMessagesTo(String selector, String destinationName, int maximumMessages) throws Exception
Description copied from interface:QueueViewMBean
Copies the messages matching the given selector up to the maximum number of matched messages- Specified by:
copyMatchingMessagesTo
in interfaceQueueViewMBean
- Returns:
- the number of messages copied
- Throws:
Exception
-
moveMessageTo
public boolean moveMessageTo(String messageId, String destinationName) throws Exception
Description copied from interface:QueueViewMBean
Moves the message to another destination.- Specified by:
moveMessageTo
in interfaceQueueViewMBean
- Returns:
- true if the message was found and was successfully copied to the other destination.
- Throws:
Exception
-
moveMatchingMessagesTo
public int moveMatchingMessagesTo(String selector, String destinationName) throws Exception
Description copied from interface:QueueViewMBean
Moves the messages matching the given selector- Specified by:
moveMatchingMessagesTo
in interfaceQueueViewMBean
- Returns:
- the number of messages removed
- Throws:
Exception
-
moveMatchingMessagesTo
public int moveMatchingMessagesTo(String selector, String destinationName, int maximumMessages) throws Exception
Description copied from interface:QueueViewMBean
Moves the messages matching the given selector up to the maximum number of matched messages- Specified by:
moveMatchingMessagesTo
in interfaceQueueViewMBean
- Throws:
Exception
-
retryMessages
public int retryMessages() throws Exception
Description copied from interface:QueueViewMBean
Retries messages sent to the DLQ- Specified by:
retryMessages
in interfaceQueueViewMBean
- Throws:
Exception
-
retryMessage
public boolean retryMessage(String messageId) throws Exception
Moves a message back to its original destination- Specified by:
retryMessage
in interfaceQueueViewMBean
- Throws:
Exception
-
cursorSize
public int cursorSize()
- Specified by:
cursorSize
in interfaceQueueViewMBean
- Returns:
- the number of messages available to be paged in by the cursor
-
doesCursorHaveMessagesBuffered
public boolean doesCursorHaveMessagesBuffered()
- Specified by:
doesCursorHaveMessagesBuffered
in interfaceQueueViewMBean
- Returns:
- true if the cursor has messages buffered to deliver
-
doesCursorHaveSpace
public boolean doesCursorHaveSpace()
- Specified by:
doesCursorHaveSpace
in interfaceQueueViewMBean
- Returns:
- true if the message cursor has memory space available to page in more messages
-
getCursorMemoryUsage
public long getCursorMemoryUsage()
- Specified by:
getCursorMemoryUsage
in interfaceQueueViewMBean
- Returns:
- the cursor memory usage in bytes
-
getCursorPercentUsage
public int getCursorPercentUsage()
- Specified by:
getCursorPercentUsage
in interfaceQueueViewMBean
- Returns:
- the cursor memory usage as a percentage
-
isCursorFull
public boolean isCursorFull()
- Specified by:
isCursorFull
in interfaceQueueViewMBean
- Returns:
- true if the cursor has reached its memory limit for paged in messages
-
isCacheEnabled
public boolean isCacheEnabled()
- Specified by:
isCacheEnabled
in interfaceQueueViewMBean
- Returns:
- true if caching is currently enabled of for the destination
-
getMessageGroups
public Map<String,String> getMessageGroups()
- Specified by:
getMessageGroups
in interfaceQueueViewMBean
- Returns:
- a Map of groupNames and ConsumerIds
-
getMessageGroupType
public String getMessageGroupType()
- Specified by:
getMessageGroupType
in interfaceQueueViewMBean
- Returns:
- the message group type implementation (simple,bucket,cached)
-
removeMessageGroup
public void removeMessageGroup(String groupName)
remove a message group = has the effect of rebalancing group- Specified by:
removeMessageGroup
in interfaceQueueViewMBean
-
removeAllMessageGroups
public void removeAllMessageGroups()
remove all the message groups - will rebalance all message groups across consumers- Specified by:
removeAllMessageGroups
in interfaceQueueViewMBean
-
pause
public void pause()
- Specified by:
pause
in interfaceQueueViewMBean
-
resume
public void resume()
- Specified by:
resume
in interfaceQueueViewMBean
-
isPaused
public boolean isPaused()
- Specified by:
isPaused
in interfaceQueueViewMBean
-
-