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 ManagedRegionBroker
broker
protected Destination
destination
-
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)
TabularData
browseAsTable()
TabularData
browseAsTable(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 messagesvoid
gc()
double
getAverageBlockedTime()
double
getAverageEnqueueTime()
long
getAverageMessageSize()
long
getBlockedProducerWarningInterval()
long
getBlockedSends()
long
getConsumerCount()
Returns the number of consumers subscribed this destination.long
getDequeueCount()
Returns the number of messages that have been acknowledged from the destination.long
getDispatchCount()
Returns the number of messages that have been delivered (potentially not acknowledged) to consumers.long
getDuplicateFromStoreCount()
Returns the number of duplicate messages that have been paged-in from the store.long
getEnqueueCount()
Returns the number of messages that have been sent to the destination.long
getExpiredCount()
Returns the number of messages that have expiredlong
getForwardCount()
Returns the number of messages that have been acknowledged by network subscriptions from the destination.long
getInFlightCount()
Returns the number of messages that have been dispatched but not acknowledgedint
getMaxAuditDepth()
long
getMaxEnqueueTime()
long
getMaxMessageSize()
int
getMaxPageSize()
int
getMaxProducersToAudit()
long
getMemoryLimit()
int
getMemoryPercentUsage()
long
getMemoryUsageByteCount()
float
getMemoryUsagePortion()
long
getMessagesCached()
long
getMinEnqueueTime()
long
getMinMessageSize()
String
getName()
Returns the name of this destinationString
getOptions()
long
getProducerCount()
long
getQueueSize()
Returns the number of messages in this destination which are yet to be consumedObjectName
getSlowConsumerStrategy()
Returns the slow consumer strategy MBean for this destinationlong
getStoreMessageSize()
Returns the memory size of all messages in this destination's storeObjectName[]
getSubscriptions()
Returns all the current subscription MBeans matching this destinationlong
getTempUsageLimit()
int
getTempUsagePercentUsage()
long
getTotalBlockedTime()
boolean
isAlwaysRetroactive()
boolean
isDLQ()
boolean
isEnableAudit()
boolean
isPrioritizedMessages()
boolean
isProducerFlowControl()
boolean
isSendDuplicateFromStoreToDLQ()
Returns the config setting to send a duplicate message from store to the dead letter queue.boolean
isUseCache()
void
resetStatistics()
Resets the management counters.String
sendTextMessage(String body)
Sends a TextMesage to the destination.String
sendTextMessage(String body, String user, String password)
Sends a TextMesage to the destination.String
sendTextMessage(Map<String,String> headers, String body, String userName, String password)
String
sendTextMessage(Map headers, String body)
Sends a TextMesage to the destination.String
sendTextMessageWithProperties(String properties)
Sends a TextMessage to the destination.String
sendTextMessageWithProperties(String properties, String delimiter)
Sends a TextMessage to the destination.void
setAlwaysRetroactive(boolean alwaysRetroactive)
void
setBlockedProducerWarningInterval(long blockedProducerWarningInterval)
Set's the interval at which warnings about producers being blocked by resource usage will be triggered.void
setDLQ(boolean val)
void
setEnableAudit(boolean enableAudit)
void
setMaxAuditDepth(int maxAuditDepth)
void
setMaxPageSize(int pageSize)
void
setMaxProducersToAudit(int maxProducersToAudit)
void
setMemoryLimit(long limit)
set the amount of memory allocated to this destinationvoid
setMemoryUsagePortion(float value)
set the portion of memory from the broker memory limit for this destinationvoid
setProducerFlowControl(boolean producerFlowControl)
void
setTempUsageLimit(long limit)
set the amount of temp usage allocated to this destinationvoid
setUseCache(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:DestinationViewMBean
Returns the name of this destination- Specified by:
getName
in interfaceDestinationViewMBean
-
resetStatistics
public void resetStatistics()
Description copied from interface:DestinationViewMBean
Resets the management counters.- Specified by:
resetStatistics
in interfaceDestinationViewMBean
-
getEnqueueCount
public long getEnqueueCount()
Description copied from interface:DestinationViewMBean
Returns the number of messages that have been sent to the destination.- Specified by:
getEnqueueCount
in interfaceDestinationViewMBean
- Returns:
- The number of messages that have been sent to the destination.
-
getDequeueCount
public long getDequeueCount()
Description copied from interface:DestinationViewMBean
Returns the number of messages that have been acknowledged from the destination.- Specified by:
getDequeueCount
in interfaceDestinationViewMBean
- Returns:
- The number of messages that have been acknowledged from the destination.
-
getForwardCount
public long getForwardCount()
Description copied from interface:DestinationViewMBean
Returns the number of messages that have been acknowledged by network subscriptions from the destination.- Specified by:
getForwardCount
in interfaceDestinationViewMBean
- Returns:
- The number of messages that have been acknowledged by network subscriptions from the destination.
-
getDispatchCount
public long getDispatchCount()
Description copied from interface:DestinationViewMBean
Returns the number of messages that have been delivered (potentially not acknowledged) to consumers.- Specified by:
getDispatchCount
in interfaceDestinationViewMBean
- Returns:
- The number of messages that have been delivered (potentially not acknowledged) to consumers.
-
getDuplicateFromStoreCount
public long getDuplicateFromStoreCount()
Description copied from interface:DestinationViewMBean
Returns the number of duplicate messages that have been paged-in from the store.- Specified by:
getDuplicateFromStoreCount
in interfaceDestinationViewMBean
- Returns:
- The number of duplicate messages that have been paged-in from the store.
-
getInFlightCount
public long getInFlightCount()
Description copied from interface:DestinationViewMBean
Returns the number of messages that have been dispatched but not acknowledged- Specified by:
getInFlightCount
in interfaceDestinationViewMBean
- Returns:
- The number of messages that have been dispatched but not acknowledged
-
getExpiredCount
public long getExpiredCount()
Description copied from interface:DestinationViewMBean
Returns the number of messages that have expired- Specified by:
getExpiredCount
in interfaceDestinationViewMBean
- Returns:
- The number of messages that have expired
-
getConsumerCount
public long getConsumerCount()
Description copied from interface:DestinationViewMBean
Returns the number of consumers subscribed this destination.- Specified by:
getConsumerCount
in interfaceDestinationViewMBean
- Returns:
- The number of consumers subscribed this destination.
-
getQueueSize
public long getQueueSize()
Description copied from interface:DestinationViewMBean
Returns the number of messages in this destination which are yet to be consumed- Specified by:
getQueueSize
in interfaceDestinationViewMBean
- Returns:
- Returns the number of messages in this destination which are yet to be consumed
-
getStoreMessageSize
public long getStoreMessageSize()
Description copied from interface:DestinationViewMBean
Returns the memory size of all messages in this destination's store- Specified by:
getStoreMessageSize
in interfaceDestinationViewMBean
- Returns:
- Returns the memory size of all messages in this destination's store
-
getMessagesCached
public long getMessagesCached()
-
getMemoryPercentUsage
public int getMemoryPercentUsage()
- Specified by:
getMemoryPercentUsage
in interfaceDestinationViewMBean
- Returns:
- the percentage of amount of memory used
-
getMemoryUsageByteCount
public long getMemoryUsageByteCount()
- Specified by:
getMemoryUsageByteCount
in interfaceDestinationViewMBean
- Returns:
- the amount of memory currently used by this destination
-
getMemoryLimit
public long getMemoryLimit()
- Specified by:
getMemoryLimit
in interfaceDestinationViewMBean
- Returns:
- the amount of memory allocated to this destination
-
setMemoryLimit
public void setMemoryLimit(long limit)
Description copied from interface:DestinationViewMBean
set the amount of memory allocated to this destination- Specified by:
setMemoryLimit
in interfaceDestinationViewMBean
-
getAverageEnqueueTime
public double getAverageEnqueueTime()
- Specified by:
getAverageEnqueueTime
in interfaceDestinationViewMBean
-
getTempUsagePercentUsage
public int getTempUsagePercentUsage()
- Specified by:
getTempUsagePercentUsage
in interfaceDestinationViewMBean
- Returns:
- the percentage of amount of temp usage used
-
getTempUsageLimit
public long getTempUsageLimit()
- Specified by:
getTempUsageLimit
in interfaceDestinationViewMBean
- Returns:
- the amount of temp usage allocated to this destination
-
setTempUsageLimit
public void setTempUsageLimit(long limit)
Description copied from interface:DestinationViewMBean
set the amount of temp usage allocated to this destination- Specified by:
setTempUsageLimit
in interfaceDestinationViewMBean
- Parameters:
limit
- the amount of temp usage allocated to this destination
-
getMaxEnqueueTime
public long getMaxEnqueueTime()
- Specified by:
getMaxEnqueueTime
in interfaceDestinationViewMBean
- Returns:
- longest time a message is held by a destination
-
getMinEnqueueTime
public long getMinEnqueueTime()
- Specified by:
getMinEnqueueTime
in interfaceDestinationViewMBean
- Returns:
- shortest time a message is held by a destination
-
getAverageMessageSize
public long getAverageMessageSize()
- Specified by:
getAverageMessageSize
in interfaceDestinationViewMBean
- Returns:
- the average size of a message (bytes)
-
getMaxMessageSize
public long getMaxMessageSize()
- Specified by:
getMaxMessageSize
in interfaceDestinationViewMBean
- Returns:
- the max size of a message (bytes)
-
getMinMessageSize
public long getMinMessageSize()
- Specified by:
getMinMessageSize
in interfaceDestinationViewMBean
- Returns:
- the min size of a message (bytes)
-
isPrioritizedMessages
public boolean isPrioritizedMessages()
- Specified by:
isPrioritizedMessages
in interfaceDestinationViewMBean
- Returns:
- true if prioritized messages are enabled for the destination
-
browse
public CompositeData[] browse() throws OpenDataException
- Specified by:
browse
in 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:
browse
in interfaceDestinationViewMBean
- Returns:
- An array of all the messages in the destination's queue.
- Throws:
InvalidSelectorException
OpenDataException
-
browseMessages
public List<Object> browseMessages() throws InvalidSelectorException
Browses the current destination returning a list of messages- Specified by:
browseMessages
in 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:
browseMessages
in interfaceDestinationViewMBean
- Throws:
InvalidSelectorException
-
browseAsTable
public TabularData browseAsTable() throws OpenDataException
- Specified by:
browseAsTable
in 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:
browseAsTable
in interfaceDestinationViewMBean
- Returns:
- A list of all the messages in the destination's queue.
- Throws:
InvalidSelectorException
OpenDataException
-
sendTextMessageWithProperties
public String sendTextMessageWithProperties(String properties) throws Exception
Description copied from interface:DestinationViewMBean
Sends a TextMessage to the destination.- Specified by:
sendTextMessageWithProperties
in 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:DestinationViewMBean
Sends a TextMessage to the destination.- Specified by:
sendTextMessageWithProperties
in 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:DestinationViewMBean
Sends a TextMesage to the destination.- Specified by:
sendTextMessage
in 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:DestinationViewMBean
Sends a TextMesage to the destination.- Specified by:
sendTextMessage
in 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:DestinationViewMBean
Sends a TextMesage to the destination.- Specified by:
sendTextMessage
in 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:
sendTextMessage
in 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:
getMaxAuditDepth
in interfaceDestinationViewMBean
- Returns:
- the maxAuditDepth
-
getMaxProducersToAudit
public int getMaxProducersToAudit()
- Specified by:
getMaxProducersToAudit
in interfaceDestinationViewMBean
- Returns:
- the maxProducersToAudit
-
isEnableAudit
public boolean isEnableAudit()
-
setEnableAudit
public void setEnableAudit(boolean enableAudit)
-
setMaxAuditDepth
public void setMaxAuditDepth(int maxAuditDepth)
- Specified by:
setMaxAuditDepth
in interfaceDestinationViewMBean
- Parameters:
maxAuditDepth
- the maxAuditDepth to set
-
setMaxProducersToAudit
public void setMaxProducersToAudit(int maxProducersToAudit)
- Specified by:
setMaxProducersToAudit
in interfaceDestinationViewMBean
- Parameters:
maxProducersToAudit
- the maxProducersToAudit to set
-
getMemoryUsagePortion
public float getMemoryUsagePortion()
- Specified by:
getMemoryUsagePortion
in interfaceDestinationViewMBean
- Returns:
- the portion of memory from the broker memory limit for this destination
-
getProducerCount
public long getProducerCount()
- Specified by:
getProducerCount
in interfaceDestinationViewMBean
- Returns:
- the number of producers publishing to the destination
-
isProducerFlowControl
public boolean isProducerFlowControl()
- Specified by:
isProducerFlowControl
in interfaceDestinationViewMBean
- Returns:
- the producerFlowControl
-
setMemoryUsagePortion
public void setMemoryUsagePortion(float value)
Description copied from interface:DestinationViewMBean
set the portion of memory from the broker memory limit for this destination- Specified by:
setMemoryUsagePortion
in interfaceDestinationViewMBean
-
setProducerFlowControl
public void setProducerFlowControl(boolean producerFlowControl)
- Specified by:
setProducerFlowControl
in interfaceDestinationViewMBean
- Parameters:
producerFlowControl
- the producerFlowControl to set
-
isAlwaysRetroactive
public boolean isAlwaysRetroactive()
- Specified by:
isAlwaysRetroactive
in interfaceDestinationViewMBean
- Returns:
- if we treat consumers as alwaysRetroactive
-
setAlwaysRetroactive
public void setAlwaysRetroactive(boolean alwaysRetroactive)
- Specified by:
setAlwaysRetroactive
in 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:
setBlockedProducerWarningInterval
in interfaceDestinationViewMBean
- Parameters:
blockedProducerWarningInterval
- the interval at which warning about blocked producers will be triggered.
-
getBlockedProducerWarningInterval
public long getBlockedProducerWarningInterval()
- Specified by:
getBlockedProducerWarningInterval
in interfaceDestinationViewMBean
- Returns:
- the interval at which warning about blocked producers will be triggered.
-
getMaxPageSize
public int getMaxPageSize()
- Specified by:
getMaxPageSize
in interfaceDestinationViewMBean
- Returns:
- the maximum number of message to be paged into the destination
-
setMaxPageSize
public void setMaxPageSize(int pageSize)
- Specified by:
setMaxPageSize
in interfaceDestinationViewMBean
- Parameters:
pageSize
- Set the maximum number of messages to page into the destination
-
isUseCache
public boolean isUseCache()
- Specified by:
isUseCache
in interfaceDestinationViewMBean
- Returns:
- true if caching is allowed of for the destination
-
setUseCache
public void setUseCache(boolean value)
- Specified by:
setUseCache
in interfaceDestinationViewMBean
- Parameters:
value
- enable/disable caching on the destination
-
getSubscriptions
public ObjectName[] getSubscriptions() throws IOException, MalformedObjectNameException
Description copied from interface:DestinationViewMBean
Returns all the current subscription MBeans matching this destination- Specified by:
getSubscriptions
in interfaceDestinationViewMBean
- Returns:
- the names of the subscriptions for this destination
- Throws:
IOException
MalformedObjectNameException
-
getSlowConsumerStrategy
public ObjectName getSlowConsumerStrategy() throws IOException, MalformedObjectNameException
Description copied from interface:DestinationViewMBean
Returns the slow consumer strategy MBean for this destination- Specified by:
getSlowConsumerStrategy
in interfaceDestinationViewMBean
- Returns:
- the name of the slow consumer handler MBean for this destination
- Throws:
IOException
MalformedObjectNameException
-
getOptions
public String getOptions()
- Specified by:
getOptions
in interfaceDestinationViewMBean
- Returns:
- A string of destination options, name value pairs as URL queryString.
-
isDLQ
public boolean isDLQ()
- Specified by:
isDLQ
in interfaceDestinationViewMBean
- Returns:
- true if this is dead letter queue
-
setDLQ
public void setDLQ(boolean val)
- Specified by:
setDLQ
in interfaceDestinationViewMBean
- Parameters:
val
- enable/disable the DLQ flag
-
getBlockedSends
public long getBlockedSends()
- Specified by:
getBlockedSends
in interfaceDestinationViewMBean
-
getAverageBlockedTime
public double getAverageBlockedTime()
- Specified by:
getAverageBlockedTime
in interfaceDestinationViewMBean
-
getTotalBlockedTime
public long getTotalBlockedTime()
- Specified by:
getTotalBlockedTime
in interfaceDestinationViewMBean
-
isSendDuplicateFromStoreToDLQ
public boolean isSendDuplicateFromStoreToDLQ()
Description copied from interface:DestinationViewMBean
Returns the config setting to send a duplicate message from store to the dead letter queue.- Specified by:
isSendDuplicateFromStoreToDLQ
in interfaceDestinationViewMBean
- Returns:
- The config setting to send a duplicate message from store to the dead letter queue.
-
-