Package org.apache.activemq.broker.jmx
Class DestinationView
- java.lang.Object
-
- org.apache.activemq.broker.jmx.DestinationView
-
- All Implemented Interfaces:
DestinationViewMBean
public class DestinationView extends Object implements DestinationViewMBean
-
-
Field Summary
Fields Modifier and Type Field Description protected ManagedRegionBrokerbrokerprotected Destinationdestination
-
Constructor Summary
Constructors Constructor Description DestinationView(ManagedRegionBroker broker, Destination destination)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompositeData[]browse()CompositeData[]browse(String selector)TabularDatabrowseAsTable()TabularDatabrowseAsTable(String selector)List<Object>browseMessages()Browses the current destination returning a list of messagesList<Object>browseMessages(String selector)Browses the current destination with the given selector returning a list of messagesvoidgc()doublegetAverageBlockedTime()doublegetAverageEnqueueTime()longgetAverageMessageSize()longgetBlockedProducerWarningInterval()longgetBlockedSends()longgetConsumerCount()Returns the number of consumers subscribed this destination.longgetDequeueCount()Returns the number of messages that have been acknowledged from the destination.longgetDispatchCount()Returns the number of messages that have been delivered (potentially not acknowledged) to consumers.longgetDuplicateFromStoreCount()Returns the number of duplicate messages that have been paged-in from the store.longgetEnqueueCount()Returns the number of messages that have been sent to the destination.longgetExpiredCount()Returns the number of messages that have expiredlonggetForwardCount()Returns the number of messages that have been acknowledged by network subscriptions from the destination.longgetInFlightCount()Returns the number of messages that have been dispatched but not acknowledgedintgetMaxAuditDepth()longgetMaxEnqueueTime()longgetMaxMessageSize()intgetMaxPageSize()intgetMaxProducersToAudit()longgetMemoryLimit()intgetMemoryPercentUsage()longgetMemoryUsageByteCount()floatgetMemoryUsagePortion()longgetMessagesCached()longgetMinEnqueueTime()longgetMinMessageSize()StringgetName()Returns the name of this destinationStringgetOptions()longgetProducerCount()longgetQueueSize()Returns the number of messages in this destination which are yet to be consumedObjectNamegetSlowConsumerStrategy()Returns the slow consumer strategy MBean for this destinationlonggetStoreMessageSize()Returns the memory size of all messages in this destination's storeObjectName[]getSubscriptions()Returns all the current subscription MBeans matching this destinationlonggetTempUsageLimit()intgetTempUsagePercentUsage()longgetTotalBlockedTime()booleanisAlwaysRetroactive()booleanisDLQ()booleanisEnableAudit()booleanisPrioritizedMessages()booleanisProducerFlowControl()booleanisSendDuplicateFromStoreToDLQ()Returns the config setting to send a duplicate message from store to the dead letter queue.booleanisUseCache()voidresetStatistics()Resets the management counters.StringsendTextMessage(String body)Sends a TextMesage to the destination.StringsendTextMessage(String body, String user, String password)Sends a TextMesage to the destination.StringsendTextMessage(Map<String,String> headers, String body, String userName, String password)StringsendTextMessage(Map headers, String body)Sends a TextMesage to the destination.StringsendTextMessageWithProperties(String properties)Sends a TextMessage to the destination.StringsendTextMessageWithProperties(String properties, String delimiter)Sends a TextMessage to the destination.voidsetAlwaysRetroactive(boolean alwaysRetroactive)voidsetBlockedProducerWarningInterval(long blockedProducerWarningInterval)Set's the interval at which warnings about producers being blocked by resource usage will be triggered.voidsetDLQ(boolean val)voidsetEnableAudit(boolean enableAudit)voidsetMaxAuditDepth(int maxAuditDepth)voidsetMaxPageSize(int pageSize)voidsetMaxProducersToAudit(int maxProducersToAudit)voidsetMemoryLimit(long limit)set the amount of memory allocated to this destinationvoidsetMemoryUsagePortion(float value)set the portion of memory from the broker memory limit for this destinationvoidsetProducerFlowControl(boolean producerFlowControl)voidsetTempUsageLimit(long limit)set the amount of temp usage allocated to this destinationvoidsetUseCache(boolean value)
-
-
-
Field Detail
-
destination
protected final Destination destination
-
broker
protected final ManagedRegionBroker broker
-
-
Constructor Detail
-
DestinationView
public DestinationView(ManagedRegionBroker broker, Destination destination)
-
-
Method Detail
-
gc
public void gc()
-
getName
public String getName()
Description copied from interface:DestinationViewMBeanReturns the name of this destination- Specified by:
getNamein interfaceDestinationViewMBean
-
resetStatistics
public void resetStatistics()
Description copied from interface:DestinationViewMBeanResets the management counters.- Specified by:
resetStatisticsin interfaceDestinationViewMBean
-
getEnqueueCount
public long getEnqueueCount()
Description copied from interface:DestinationViewMBeanReturns the number of messages that have been sent to the destination.- Specified by:
getEnqueueCountin interfaceDestinationViewMBean- Returns:
- The number of messages that have been sent to the destination.
-
getDequeueCount
public long getDequeueCount()
Description copied from interface:DestinationViewMBeanReturns the number of messages that have been acknowledged from the destination.- Specified by:
getDequeueCountin interfaceDestinationViewMBean- Returns:
- The number of messages that have been acknowledged from the destination.
-
getForwardCount
public long getForwardCount()
Description copied from interface:DestinationViewMBeanReturns the number of messages that have been acknowledged by network subscriptions from the destination.- Specified by:
getForwardCountin interfaceDestinationViewMBean- Returns:
- The number of messages that have been acknowledged by network subscriptions from the destination.
-
getDispatchCount
public long getDispatchCount()
Description copied from interface:DestinationViewMBeanReturns the number of messages that have been delivered (potentially not acknowledged) to consumers.- Specified by:
getDispatchCountin interfaceDestinationViewMBean- Returns:
- The number of messages that have been delivered (potentially not acknowledged) to consumers.
-
getDuplicateFromStoreCount
public long getDuplicateFromStoreCount()
Description copied from interface:DestinationViewMBeanReturns the number of duplicate messages that have been paged-in from the store.- Specified by:
getDuplicateFromStoreCountin interfaceDestinationViewMBean- Returns:
- The number of duplicate messages that have been paged-in from the store.
-
getInFlightCount
public long getInFlightCount()
Description copied from interface:DestinationViewMBeanReturns the number of messages that have been dispatched but not acknowledged- Specified by:
getInFlightCountin interfaceDestinationViewMBean- Returns:
- The number of messages that have been dispatched but not acknowledged
-
getExpiredCount
public long getExpiredCount()
Description copied from interface:DestinationViewMBeanReturns the number of messages that have expired- Specified by:
getExpiredCountin interfaceDestinationViewMBean- Returns:
- The number of messages that have expired
-
getConsumerCount
public long getConsumerCount()
Description copied from interface:DestinationViewMBeanReturns the number of consumers subscribed this destination.- Specified by:
getConsumerCountin interfaceDestinationViewMBean- Returns:
- The number of consumers subscribed this destination.
-
getQueueSize
public long getQueueSize()
Description copied from interface:DestinationViewMBeanReturns the number of messages in this destination which are yet to be consumed- Specified by:
getQueueSizein interfaceDestinationViewMBean- Returns:
- Returns the number of messages in this destination which are yet to be consumed
-
getStoreMessageSize
public long getStoreMessageSize()
Description copied from interface:DestinationViewMBeanReturns the memory size of all messages in this destination's store- Specified by:
getStoreMessageSizein interfaceDestinationViewMBean- Returns:
- Returns the memory size of all messages in this destination's store
-
getMessagesCached
public long getMessagesCached()
-
getMemoryPercentUsage
public int getMemoryPercentUsage()
- Specified by:
getMemoryPercentUsagein interfaceDestinationViewMBean- Returns:
- the percentage of amount of memory used
-
getMemoryUsageByteCount
public long getMemoryUsageByteCount()
- Specified by:
getMemoryUsageByteCountin interfaceDestinationViewMBean- Returns:
- the amount of memory currently used by this destination
-
getMemoryLimit
public long getMemoryLimit()
- Specified by:
getMemoryLimitin interfaceDestinationViewMBean- Returns:
- the amount of memory allocated to this destination
-
setMemoryLimit
public void setMemoryLimit(long limit)
Description copied from interface:DestinationViewMBeanset the amount of memory allocated to this destination- Specified by:
setMemoryLimitin interfaceDestinationViewMBean
-
getAverageEnqueueTime
public double getAverageEnqueueTime()
- Specified by:
getAverageEnqueueTimein interfaceDestinationViewMBean
-
getTempUsagePercentUsage
public int getTempUsagePercentUsage()
- Specified by:
getTempUsagePercentUsagein interfaceDestinationViewMBean- Returns:
- the percentage of amount of temp usage used
-
getTempUsageLimit
public long getTempUsageLimit()
- Specified by:
getTempUsageLimitin interfaceDestinationViewMBean- Returns:
- the amount of temp usage allocated to this destination
-
setTempUsageLimit
public void setTempUsageLimit(long limit)
Description copied from interface:DestinationViewMBeanset the amount of temp usage allocated to this destination- Specified by:
setTempUsageLimitin interfaceDestinationViewMBean- Parameters:
limit- the amount of temp usage allocated to this destination
-
getMaxEnqueueTime
public long getMaxEnqueueTime()
- Specified by:
getMaxEnqueueTimein interfaceDestinationViewMBean- Returns:
- longest time a message is held by a destination
-
getMinEnqueueTime
public long getMinEnqueueTime()
- Specified by:
getMinEnqueueTimein interfaceDestinationViewMBean- Returns:
- shortest time a message is held by a destination
-
getAverageMessageSize
public long getAverageMessageSize()
- Specified by:
getAverageMessageSizein interfaceDestinationViewMBean- Returns:
- the average size of a message (bytes)
-
getMaxMessageSize
public long getMaxMessageSize()
- Specified by:
getMaxMessageSizein interfaceDestinationViewMBean- Returns:
- the max size of a message (bytes)
-
getMinMessageSize
public long getMinMessageSize()
- Specified by:
getMinMessageSizein interfaceDestinationViewMBean- Returns:
- the min size of a message (bytes)
-
isPrioritizedMessages
public boolean isPrioritizedMessages()
- Specified by:
isPrioritizedMessagesin interfaceDestinationViewMBean- Returns:
- true if prioritized messages are enabled for the destination
-
browse
public CompositeData[] browse() throws OpenDataException
- Specified by:
browsein interfaceDestinationViewMBean- Returns:
- An array of all the messages in the destination's queue.
- Throws:
OpenDataException
-
browse
public CompositeData[] browse(String selector) throws OpenDataException, InvalidSelectorException
- Specified by:
browsein interfaceDestinationViewMBean- Returns:
- An array of all the messages in the destination's queue.
- Throws:
InvalidSelectorExceptionOpenDataException
-
browseMessages
public List<Object> browseMessages() throws InvalidSelectorException
Browses the current destination returning a list of messages- Specified by:
browseMessagesin interfaceDestinationViewMBean- Throws:
InvalidSelectorException
-
browseMessages
public List<Object> browseMessages(String selector) throws InvalidSelectorException
Browses the current destination with the given selector returning a list of messages- Specified by:
browseMessagesin interfaceDestinationViewMBean- Throws:
InvalidSelectorException
-
browseAsTable
public TabularData browseAsTable() throws OpenDataException
- Specified by:
browseAsTablein interfaceDestinationViewMBean- Returns:
- A list of all the messages in the destination's queue.
- Throws:
OpenDataException
-
browseAsTable
public TabularData browseAsTable(String selector) throws OpenDataException, InvalidSelectorException
- Specified by:
browseAsTablein interfaceDestinationViewMBean- Returns:
- A list of all the messages in the destination's queue.
- Throws:
InvalidSelectorExceptionOpenDataException
-
sendTextMessageWithProperties
public String sendTextMessageWithProperties(String properties) throws Exception
Description copied from interface:DestinationViewMBeanSends a TextMessage to the destination.- Specified by:
sendTextMessageWithPropertiesin interfaceDestinationViewMBean- Parameters:
properties- the message properties to set as name=value list separated by a comma. Can only contain Strings mapped to primitive types or JMS properties. eg: body=hi,JMSReplyTo=Queue2- Returns:
- the message id of the message sent.
- Throws:
Exception
-
sendTextMessageWithProperties
public String sendTextMessageWithProperties(String properties, String delimiter) throws Exception
Description copied from interface:DestinationViewMBeanSends a TextMessage to the destination.- Specified by:
sendTextMessageWithPropertiesin interfaceDestinationViewMBean- Parameters:
properties- the message properties to set as name=value list separated by a custom delimiter. Can only contain Strings mapped to primitive types or JMS properties. eg: body=hi,JMSReplyTo=Queue2delimiter- The delimiter that separates each property. Defaults to comma if none is provided.- Returns:
- the message id of the message sent.
- Throws:
Exception
-
sendTextMessage
public String sendTextMessage(String body) throws Exception
Description copied from interface:DestinationViewMBeanSends a TextMesage to the destination.- Specified by:
sendTextMessagein interfaceDestinationViewMBean- Parameters:
body- the text to send- Returns:
- the message id of the message sent.
- Throws:
Exception
-
sendTextMessage
public String sendTextMessage(Map headers, String body) throws Exception
Description copied from interface:DestinationViewMBeanSends a TextMesage to the destination.- Specified by:
sendTextMessagein interfaceDestinationViewMBean- Parameters:
headers- the message headers and properties to set. Can only container Strings maped to primitive types.body- the text to send- Returns:
- the message id of the message sent.
- Throws:
Exception
-
sendTextMessage
public String sendTextMessage(String body, String user, String password) throws Exception
Description copied from interface:DestinationViewMBeanSends a TextMesage to the destination.- Specified by:
sendTextMessagein interfaceDestinationViewMBean- Parameters:
body- the text to send- Returns:
- a string value
- Throws:
Exception
-
sendTextMessage
public String sendTextMessage(Map<String,String> headers, String body, String userName, String password) throws Exception
- Specified by:
sendTextMessagein interfaceDestinationViewMBean- Parameters:
headers- the message headers and properties to set. Can only container Strings maped to primitive types.body- the text to send- Returns:
- a string value
- Throws:
Exception
-
getMaxAuditDepth
public int getMaxAuditDepth()
- Specified by:
getMaxAuditDepthin interfaceDestinationViewMBean- Returns:
- the maxAuditDepth
-
getMaxProducersToAudit
public int getMaxProducersToAudit()
- Specified by:
getMaxProducersToAuditin interfaceDestinationViewMBean- Returns:
- the maxProducersToAudit
-
isEnableAudit
public boolean isEnableAudit()
-
setEnableAudit
public void setEnableAudit(boolean enableAudit)
-
setMaxAuditDepth
public void setMaxAuditDepth(int maxAuditDepth)
- Specified by:
setMaxAuditDepthin interfaceDestinationViewMBean- Parameters:
maxAuditDepth- the maxAuditDepth to set
-
setMaxProducersToAudit
public void setMaxProducersToAudit(int maxProducersToAudit)
- Specified by:
setMaxProducersToAuditin interfaceDestinationViewMBean- Parameters:
maxProducersToAudit- the maxProducersToAudit to set
-
getMemoryUsagePortion
public float getMemoryUsagePortion()
- Specified by:
getMemoryUsagePortionin interfaceDestinationViewMBean- Returns:
- the portion of memory from the broker memory limit for this destination
-
getProducerCount
public long getProducerCount()
- Specified by:
getProducerCountin interfaceDestinationViewMBean- Returns:
- the number of producers publishing to the destination
-
isProducerFlowControl
public boolean isProducerFlowControl()
- Specified by:
isProducerFlowControlin interfaceDestinationViewMBean- Returns:
- the producerFlowControl
-
setMemoryUsagePortion
public void setMemoryUsagePortion(float value)
Description copied from interface:DestinationViewMBeanset the portion of memory from the broker memory limit for this destination- Specified by:
setMemoryUsagePortionin interfaceDestinationViewMBean
-
setProducerFlowControl
public void setProducerFlowControl(boolean producerFlowControl)
- Specified by:
setProducerFlowControlin interfaceDestinationViewMBean- Parameters:
producerFlowControl- the producerFlowControl to set
-
isAlwaysRetroactive
public boolean isAlwaysRetroactive()
- Specified by:
isAlwaysRetroactivein interfaceDestinationViewMBean- Returns:
- if we treat consumers as alwaysRetroactive
-
setAlwaysRetroactive
public void setAlwaysRetroactive(boolean alwaysRetroactive)
- Specified by:
setAlwaysRetroactivein interfaceDestinationViewMBean- Parameters:
alwaysRetroactive- set as always retroActive
-
setBlockedProducerWarningInterval
public void setBlockedProducerWarningInterval(long blockedProducerWarningInterval)
Set's the interval at which warnings about producers being blocked by resource usage will be triggered. Values of 0 or less will disable warnings- Specified by:
setBlockedProducerWarningIntervalin interfaceDestinationViewMBean- Parameters:
blockedProducerWarningInterval- the interval at which warning about blocked producers will be triggered.
-
getBlockedProducerWarningInterval
public long getBlockedProducerWarningInterval()
- Specified by:
getBlockedProducerWarningIntervalin interfaceDestinationViewMBean- Returns:
- the interval at which warning about blocked producers will be triggered.
-
getMaxPageSize
public int getMaxPageSize()
- Specified by:
getMaxPageSizein interfaceDestinationViewMBean- Returns:
- the maximum number of message to be paged into the destination
-
setMaxPageSize
public void setMaxPageSize(int pageSize)
- Specified by:
setMaxPageSizein interfaceDestinationViewMBean- Parameters:
pageSize- Set the maximum number of messages to page into the destination
-
isUseCache
public boolean isUseCache()
- Specified by:
isUseCachein interfaceDestinationViewMBean- Returns:
- true if caching is allowed of for the destination
-
setUseCache
public void setUseCache(boolean value)
- Specified by:
setUseCachein interfaceDestinationViewMBean- Parameters:
value- enable/disable caching on the destination
-
getSubscriptions
public ObjectName[] getSubscriptions() throws IOException, MalformedObjectNameException
Description copied from interface:DestinationViewMBeanReturns all the current subscription MBeans matching this destination- Specified by:
getSubscriptionsin interfaceDestinationViewMBean- Returns:
- the names of the subscriptions for this destination
- Throws:
IOExceptionMalformedObjectNameException
-
getSlowConsumerStrategy
public ObjectName getSlowConsumerStrategy() throws IOException, MalformedObjectNameException
Description copied from interface:DestinationViewMBeanReturns the slow consumer strategy MBean for this destination- Specified by:
getSlowConsumerStrategyin interfaceDestinationViewMBean- Returns:
- the name of the slow consumer handler MBean for this destination
- Throws:
IOExceptionMalformedObjectNameException
-
getOptions
public String getOptions()
- Specified by:
getOptionsin interfaceDestinationViewMBean- Returns:
- A string of destination options, name value pairs as URL queryString.
-
isDLQ
public boolean isDLQ()
- Specified by:
isDLQin interfaceDestinationViewMBean- Returns:
- true if this is dead letter queue
-
setDLQ
public void setDLQ(boolean val)
- Specified by:
setDLQin interfaceDestinationViewMBean- Parameters:
val- enable/disable the DLQ flag
-
getBlockedSends
public long getBlockedSends()
- Specified by:
getBlockedSendsin interfaceDestinationViewMBean
-
getAverageBlockedTime
public double getAverageBlockedTime()
- Specified by:
getAverageBlockedTimein interfaceDestinationViewMBean
-
getTotalBlockedTime
public long getTotalBlockedTime()
- Specified by:
getTotalBlockedTimein interfaceDestinationViewMBean
-
isSendDuplicateFromStoreToDLQ
public boolean isSendDuplicateFromStoreToDLQ()
Description copied from interface:DestinationViewMBeanReturns the config setting to send a duplicate message from store to the dead letter queue.- Specified by:
isSendDuplicateFromStoreToDLQin interfaceDestinationViewMBean- Returns:
- The config setting to send a duplicate message from store to the dead letter queue.
-
-