public class QueueControlImpl extends AbstractControl implements QueueControl
Modifier and Type | Field and Description |
---|---|
static int |
FLUSH_LIMIT |
CONSUMER_COUNT_DESCRIPTION, DELIVERING_MESSAGE_COUNT_DESCRIPTION, DELIVERING_SIZE_DESCRIPTION, DURABLE_DELIVERING_MESSAGE_COUNT_DESCRIPTION, DURABLE_DELIVERING_SIZE_DESCRIPTION, DURABLE_MESSAGE_COUNT_DESCRIPTION, DURABLE_PERSISTENT_SIZE_DESCRIPTION, DURABLE_SCHEDULED_MESSAGE_COUNT_DESCRIPTION, DURABLE_SCHEDULED_SIZE_DESCRIPTION, MESSAGE_COUNT_DESCRIPTION, MESSAGES_ACKNOWLEDGED_DESCRIPTION, MESSAGES_ADDED_DESCRIPTION, MESSAGES_EXPIRED_DESCRIPTION, MESSAGES_KILLED_DESCRIPTION, PERSISTENT_SIZE_DESCRIPTION, SCHEDULED_MESSAGE_COUNT_DESCRIPTION, SCHEDULED_SIZE_DESCRIPTION
Constructor and Description |
---|
QueueControlImpl(Queue queue,
String address,
ActiveMQServer server,
StorageManager storageManager,
SecurityStore securityStore,
HierarchicalRepository<AddressSettings> addressSettingsRepository) |
Modifier and Type | Method and Description |
---|---|
CompositeData[] |
browse() |
CompositeData[] |
browse(int page,
int pageSize) |
CompositeData[] |
browse(int page,
int pageSize,
String filter) |
CompositeData[] |
browse(String filter) |
boolean |
changeMessagePriority(long messageID,
int newPriority)
Changes the message's priority corresponding to the specified message ID to the specified priority.
|
int |
changeMessagesPriority(String filterStr,
int newPriority)
Changes the priority for all the message corresponding to the specified filter to the specified priority.
|
long |
countDeliveringMessages(String filterStr)
Counts the number of delivering messages in this queue matching the specified filter.
|
String |
countDeliveringMessages(String filterStr,
String groupByProperty)
Counts the number of delivering messages in this queue matching the specified filter, grouped by the given property field.
|
long |
countMessages() |
long |
countMessages(String filterStr)
Counts the number of messages in this queue matching the specified filter.
|
String |
countMessages(String filterStr,
String groupByProperty)
Counts the number of messages in this queue matching the specified filter, grouped by the given property field.
|
void |
disable()
Enables the queue.
|
void |
enable()
Enables the queue.
|
boolean |
expireMessage(long messageID)
Expires the message corresponding to the specified message ID.
|
int |
expireMessages(String filterStr)
Expires all the message corresponding to the specified filter.
|
protected MBeanAttributeInfo[] |
fillMBeanAttributeInfo() |
protected MBeanOperationInfo[] |
fillMBeanOperationInfo() |
void |
flushExecutor()
it will flush one cycle on internal executors, so you would be sure that any pending tasks are done before you call
any other measure.
|
long |
getAcknowledgeAttempts()
Returns the number of messages added to this queue since it was created.
|
String |
getAddress()
Returns the address this queue is bound to.
|
int |
getConsumerCount()
Returns the number of consumers consuming messages from this queue.
|
int |
getConsumersBeforeDispatch()
Return the Consumers Before Dispatch
|
String |
getDeadLetterAddress()
Returns the dead-letter address associated with this queue.
|
long |
getDelayBeforeDispatch()
Return the Consumers Before Dispatch
|
int |
getDeliveringCount()
Returns the number of messages that this queue is currently delivering to its consumers.
|
long |
getDeliveringSize()
Returns the persistent size of messages that this queue is currently delivering to its consumers.
|
int |
getDurableDeliveringCount()
Returns the number of durable messages that this queue is currently delivering to its consumers.
|
long |
getDurableDeliveringSize()
Returns the size of durable messages that this queue is currently delivering to its consumers.
|
long |
getDurableMessageCount()
Returns the number of durable messages currently in this queue.
|
long |
getDurablePersistentSize()
Returns the persistent size of durable messages currently in this queue.
|
long |
getDurableScheduledCount()
Returns the number of durable scheduled messages in this queue.
|
long |
getDurableScheduledSize()
Returns the size of durable scheduled messages in this queue.
|
String |
getExpiryAddress()
Returns the expiry address associated with this queue.
|
String |
getFilter()
Returns the filter associated with this queue.
|
protected Map<String,Object>[] |
getFirstMessage() |
Long |
getFirstMessageAge()
Returns the age of the first message in milliseconds.
|
String |
getFirstMessageAsJSON()
Returns the first message on the queue as JSON
|
Long |
getFirstMessageTimestamp()
Returns the timestamp of the first message in milliseconds.
|
int |
getGroupBuckets()
Will return the group buckets.
|
int |
getGroupCount()
Will return the current number of active groups.
|
String |
getGroupFirstKey()
Will return the header key to notify a consumer of a group change.
|
long |
getID()
Returns this queue ID.
|
String |
getLastValueKey()
The key used for the last value queues
|
int |
getMaxConsumers() |
long |
getMessageCount()
Returns the number of messages currently in this queue.
|
long |
getMessagesAcknowledged()
Returns the number of messages added to this queue since it was created.
|
long |
getMessagesAdded()
Returns the number of messages added to this queue since it was created.
|
long |
getMessagesExpired()
Returns the number of messages expired from this queue since it was created.
|
long |
getMessagesKilled()
Returns the number of messages removed from this queue since it was created due to exceeding the max delivery attempts.
|
String |
getName()
Returns the name of this queue.
|
long |
getPersistentSize()
Returns the persistent size of all messages currently in this queue.
|
int |
getPreparedTransactionMessageCount()
Will return the number of messages stuck in prepared transactions
|
long |
getRingSize()
Will return the ring size.
|
String |
getRoutingType()
The routing type of this queue.
|
long |
getScheduledCount()
Returns the number of scheduled messages in this queue.
|
long |
getScheduledSize()
Returns the size of scheduled messages in this queue.
|
String |
getUser()
Returns the user that is associated with creating the queue.
|
boolean |
isConfigurationManaged() |
boolean |
isDurable()
Returns whether this queue is durable.
|
boolean |
isEnabled() |
boolean |
isExclusive() |
boolean |
isGroupRebalance()
Returns whether the groups of this queue are automatically rebalanced.
|
boolean |
isGroupRebalancePauseDispatch()
Returns whether the dispatch is paused when groups of this queue are automatically rebalanced.
|
boolean |
isLastValue() |
boolean |
isPaused()
Returns whether the queue is paused.
|
boolean |
isPurgeOnNoConsumers() |
boolean |
isRetroactiveResource()
Returns whether this queue is used for a retroactive address.
|
boolean |
isTemporary()
Returns whether this queue is temporary.
|
String |
listConsumersAsJSON() |
Map<String,Map<String,Object>[]> |
listDeliveringMessages()
Lists all the messages being deliver per consumer.
|
String |
listDeliveringMessagesAsJSON()
Executes a conversion of
QueueControl.listDeliveringMessages() to JSON |
String |
listGroupsAsJSON() |
String |
listMessageCounter()
Lists the message counter for this queue.
|
String |
listMessageCounterAsHTML()
Lists the message counter for this queue as a HTML table.
|
String |
listMessageCounterHistory()
Lists the message counter history for this queue.
|
String |
listMessageCounterHistoryAsHTML()
Lists the message counter history for this queue as a HTML table.
|
Map<String,Object>[] |
listMessages(String filterStr)
Lists all the messages in this queue matching the specified filter.
|
String |
listMessagesAsJSON(String filter)
Lists all the messages in this queue matching the specified filter using JSON serialization.
|
Map<String,Object>[] |
listScheduledMessages()
Lists all the messages scheduled for delivery for this queue.
|
String |
listScheduledMessagesAsJSON()
Lists all the messages scheduled for delivery for this queue using JSON serialization.
|
boolean |
moveMessage(long messageID,
String otherQueueName)
Moves the message corresponding to the specified message ID to the specified other queue.
|
boolean |
moveMessage(long messageID,
String otherQueueName,
boolean rejectDuplicates)
Moves the message corresponding to the specified message ID to the specified other queue.
|
int |
moveMessages(int flushLimit,
String filterStr,
String otherQueueName,
boolean rejectDuplicates) |
int |
moveMessages(String filterStr,
String otherQueueName)
Moves all the message corresponding to the specified filter to the specified other queue.
|
int |
moveMessages(String filterStr,
String otherQueueName,
boolean rejectDuplicates)
Moves all the message corresponding to the specified filter to the specified other queue.
|
void |
pause()
Pauses the queue.
|
void |
pause(boolean persist)
Pauses the queue.
|
int |
removeAllMessages()
Removes all the message from the queue.
|
boolean |
removeMessage(long messageID)
Removes the message corresponding to the specified message ID.
|
int |
removeMessages(int flushLimit,
String filterStr)
Removes all the message corresponding to the specified filter.
|
int |
removeMessages(String filterStr)
Removes all the message corresponding to the specified filter.
|
void |
resetAllGroups()
Will reset the all the groups.
|
void |
resetGroup(String groupID)
Will reset the group matching the given groupID.
|
void |
resetMessageCounter()
Resets the message counter for this queue.
|
void |
resetMessagesAcknowledged()
Resets the MessagesAdded property
|
void |
resetMessagesAdded()
Resets the MessagesAdded property
|
void |
resetMessagesExpired()
Resets the MessagesExpired property
|
void |
resetMessagesKilled()
Resets the MessagesExpired property
|
void |
resume()
Resumes the queue.
|
boolean |
retryMessage(long messageID)
Retries the message corresponding to the given messageID to the original queue.
|
int |
retryMessages()
Retries all messages on a DLQ to their respective original queues.
|
String |
sendMessage(Map<String,String> headers,
int type,
String body,
boolean durable,
String user,
String password) |
int |
sendMessagesToDeadLetterAddress(String filterStr)
Sends all the message corresponding to the specified filter to this queue's dead letter address.
|
boolean |
sendMessageToDeadLetterAddress(long messageID)
Sends the message corresponding to the specified message ID to this queue's dead letter address.
|
void |
setMessageCounter(MessageCounter counter) |
blockOnIO, clearIO, getMBeanInfo, sendMessage, tcclCall, tcclInvoke
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
public static final int FLUSH_LIMIT
public QueueControlImpl(Queue queue, String address, ActiveMQServer server, StorageManager storageManager, SecurityStore securityStore, HierarchicalRepository<AddressSettings> addressSettingsRepository) throws Exception
Exception
public void setMessageCounter(MessageCounter counter)
public String getName()
QueueControl
getName
in interface QueueControl
public String getAddress()
QueueControl
getAddress
in interface QueueControl
public String getFilter()
QueueControl
getFilter
in interface QueueControl
public boolean isDurable()
QueueControl
isDurable
in interface QueueControl
public String getUser()
QueueControl
getUser
in interface QueueControl
public String getRoutingType()
QueueControl
getRoutingType
in interface QueueControl
public boolean isTemporary()
QueueControl
isTemporary
in interface QueueControl
public boolean isRetroactiveResource()
QueueControl
isRetroactiveResource
in interface QueueControl
public long getMessageCount()
QueueControl
getMessageCount
in interface QueueControl
public long getPersistentSize()
QueueControl
getPersistentSize
in interface QueueControl
public long getDurableMessageCount()
QueueControl
getDurableMessageCount
in interface QueueControl
public long getDurablePersistentSize()
QueueControl
getDurablePersistentSize
in interface QueueControl
public int getConsumerCount()
QueueControl
getConsumerCount
in interface QueueControl
public int getDeliveringCount()
QueueControl
getDeliveringCount
in interface QueueControl
public long getDeliveringSize()
QueueControl
getDeliveringSize
in interface QueueControl
public int getDurableDeliveringCount()
QueueControl
getDurableDeliveringCount
in interface QueueControl
public long getDurableDeliveringSize()
QueueControl
getDurableDeliveringSize
in interface QueueControl
public long getMessagesAdded()
QueueControl
getMessagesAdded
in interface QueueControl
public long getMessagesAcknowledged()
QueueControl
getMessagesAcknowledged
in interface QueueControl
public long getAcknowledgeAttempts()
QueueControl
getAcknowledgeAttempts
in interface QueueControl
public long getMessagesExpired()
QueueControl
getMessagesExpired
in interface QueueControl
public long getMessagesKilled()
QueueControl
getMessagesKilled
in interface QueueControl
public long getID()
QueueControl
getID
in interface QueueControl
public long getScheduledCount()
QueueControl
getScheduledCount
in interface QueueControl
public long getScheduledSize()
QueueControl
getScheduledSize
in interface QueueControl
public long getDurableScheduledCount()
QueueControl
getDurableScheduledCount
in interface QueueControl
public long getDurableScheduledSize()
QueueControl
getDurableScheduledSize
in interface QueueControl
public String getDeadLetterAddress()
QueueControl
getDeadLetterAddress
in interface QueueControl
public String getExpiryAddress()
QueueControl
getExpiryAddress
in interface QueueControl
public int getMaxConsumers()
getMaxConsumers
in interface QueueControl
public boolean isPurgeOnNoConsumers()
isPurgeOnNoConsumers
in interface QueueControl
public void disable() throws Exception
QueueControl
disable
in interface QueueControl
Exception
public void enable() throws Exception
QueueControl
enable
in interface QueueControl
Exception
public boolean isEnabled()
isEnabled
in interface QueueControl
public boolean isConfigurationManaged()
isConfigurationManaged
in interface QueueControl
public boolean isExclusive()
isExclusive
in interface QueueControl
public boolean isLastValue()
isLastValue
in interface QueueControl
public String getLastValueKey()
QueueControl
getLastValueKey
in interface QueueControl
public int getConsumersBeforeDispatch()
QueueControl
getConsumersBeforeDispatch
in interface QueueControl
public long getDelayBeforeDispatch()
QueueControl
getDelayBeforeDispatch
in interface QueueControl
public Map<String,Object>[] listScheduledMessages() throws Exception
QueueControl
listScheduledMessages
in interface QueueControl
Exception
public String listScheduledMessagesAsJSON() throws Exception
QueueControl
listScheduledMessagesAsJSON
in interface QueueControl
Exception
public Map<String,Map<String,Object>[]> listDeliveringMessages() throws ActiveMQException
QueueControl
Map<String,Object>[]
same way is returned by QueueControl.listScheduledMessages()
listDeliveringMessages
in interface QueueControl
ActiveMQException
public String listDeliveringMessagesAsJSON() throws Exception
QueueControl
QueueControl.listDeliveringMessages()
to JSONlistDeliveringMessagesAsJSON
in interface QueueControl
Exception
public Map<String,Object>[] listMessages(String filterStr) throws Exception
QueueControl
null
or an empty filter will list all messages from this queue.listMessages
in interface QueueControl
Exception
public String listMessagesAsJSON(String filter) throws Exception
QueueControl
null
or an empty filter will list all messages from this queue.listMessagesAsJSON
in interface QueueControl
Exception
public String getFirstMessageAsJSON() throws Exception
QueueControl
getFirstMessageAsJSON
in interface QueueControl
Exception
public Long getFirstMessageTimestamp() throws Exception
QueueControl
getFirstMessageTimestamp
in interface QueueControl
Exception
public Long getFirstMessageAge() throws Exception
QueueControl
getFirstMessageAge
in interface QueueControl
Exception
public long countMessages() throws Exception
countMessages
in interface QueueControl
Exception
public long countMessages(String filterStr) throws Exception
QueueControl
null
or an empty filter will count all messages from this queue.countMessages
in interface QueueControl
Exception
public String countMessages(String filterStr, String groupByProperty) throws Exception
QueueControl
null
or an empty filter will count all messages from this queue.countMessages
in interface QueueControl
Exception
public long countDeliveringMessages(String filterStr) throws Exception
QueueControl
null
or an empty filter will count all messages from this queue.countDeliveringMessages
in interface QueueControl
Exception
public String countDeliveringMessages(String filterStr, String groupByProperty) throws Exception
QueueControl
null
or an empty filter will count all messages from this queue.countDeliveringMessages
in interface QueueControl
Exception
public boolean removeMessage(long messageID) throws Exception
QueueControl
removeMessage
in interface QueueControl
true
if the message was removed, false
elseException
public int removeMessages(String filterStr) throws Exception
QueueControl
null
or an empty filter will remove all messages from this queue.removeMessages
in interface QueueControl
Exception
public int removeMessages(int flushLimit, String filterStr) throws Exception
QueueControl
null
or an empty filter will remove all messages from this queue.removeMessages
in interface QueueControl
Exception
public int removeAllMessages() throws Exception
QueueControl
removeAllMessages
in interface QueueControl
Exception
public boolean expireMessage(long messageID) throws Exception
QueueControl
expireMessage
in interface QueueControl
true
if the message was expired, false
elseException
public int expireMessages(String filterStr) throws Exception
QueueControl
null
or an empty filter will expire all messages from this queue.expireMessages
in interface QueueControl
Exception
public boolean retryMessage(long messageID) throws Exception
QueueControl
retryMessage
in interface QueueControl
true
if the message was retried, false
elseException
public int retryMessages() throws Exception
QueueControl
retryMessages
in interface QueueControl
Exception
public boolean moveMessage(long messageID, String otherQueueName) throws Exception
QueueControl
moveMessage
in interface QueueControl
true
if the message was moved, false
elseException
public boolean moveMessage(long messageID, String otherQueueName, boolean rejectDuplicates) throws Exception
QueueControl
moveMessage
in interface QueueControl
true
if the message was moved, false
elseException
public int moveMessages(String filterStr, String otherQueueName) throws Exception
QueueControl
null
or an empty filter will move all messages from this queue.moveMessages
in interface QueueControl
Exception
public int moveMessages(int flushLimit, String filterStr, String otherQueueName, boolean rejectDuplicates) throws Exception
moveMessages
in interface QueueControl
Exception
public int moveMessages(String filterStr, String otherQueueName, boolean rejectDuplicates) throws Exception
QueueControl
null
or an empty filter will move all messages from this queue.moveMessages
in interface QueueControl
Exception
public int sendMessagesToDeadLetterAddress(String filterStr) throws Exception
QueueControl
null
or an empty filter will send all messages from this queue.sendMessagesToDeadLetterAddress
in interface QueueControl
Exception
public String sendMessage(Map<String,String> headers, int type, String body, boolean durable, String user, String password) throws Exception
sendMessage
in interface QueueControl
headers
- the message headers and properties to set. Can only
container Strings maped to primitive types.body
- the text to sendpassword
- @returnException
public boolean sendMessageToDeadLetterAddress(long messageID) throws Exception
QueueControl
sendMessageToDeadLetterAddress
in interface QueueControl
true
if the message was sent to the dead letter address, false
elseException
public int changeMessagesPriority(String filterStr, int newPriority) throws Exception
QueueControl
null
or an empty filter will change all messages from this queue.changeMessagesPriority
in interface QueueControl
Exception
public boolean changeMessagePriority(long messageID, int newPriority) throws Exception
QueueControl
changeMessagePriority
in interface QueueControl
newPriority
- between 0 and 9 inclusive.true
if the message priority was changedException
public String listMessageCounter()
QueueControl
listMessageCounter
in interface QueueControl
public void resetMessageCounter()
QueueControl
resetMessageCounter
in interface QueueControl
public String listMessageCounterAsHTML()
QueueControl
listMessageCounterAsHTML
in interface QueueControl
public String listMessageCounterHistory() throws Exception
QueueControl
listMessageCounterHistory
in interface QueueControl
Exception
public String listMessageCounterHistoryAsHTML()
QueueControl
listMessageCounterHistoryAsHTML
in interface QueueControl
public void pause()
QueueControl
pause
in interface QueueControl
public void pause(boolean persist)
QueueControl
pause
in interface QueueControl
public void resume()
QueueControl
resume
in interface QueueControl
public boolean isPaused() throws Exception
QueueControl
isPaused
in interface QueueControl
Exception
public CompositeData[] browse(int page, int pageSize) throws Exception
browse
in interface QueueControl
Exception
public CompositeData[] browse(int page, int pageSize, String filter) throws Exception
browse
in interface QueueControl
Exception
public CompositeData[] browse() throws Exception
browse
in interface QueueControl
Exception
public CompositeData[] browse(String filter) throws Exception
browse
in interface QueueControl
Exception
public void flushExecutor()
QueueControl
flushExecutor
in interface QueueControl
public void resetAllGroups()
QueueControl
resetAllGroups
in interface QueueControl
public void resetGroup(String groupID)
QueueControl
resetGroup
in interface QueueControl
public int getGroupCount()
QueueControl
getGroupCount
in interface QueueControl
public String listGroupsAsJSON() throws Exception
listGroupsAsJSON
in interface QueueControl
Exception
public long getRingSize()
QueueControl
getRingSize
in interface QueueControl
public String listConsumersAsJSON() throws Exception
listConsumersAsJSON
in interface QueueControl
Exception
protected MBeanOperationInfo[] fillMBeanOperationInfo()
fillMBeanOperationInfo
in class AbstractControl
protected MBeanAttributeInfo[] fillMBeanAttributeInfo()
fillMBeanAttributeInfo
in class AbstractControl
public void resetMessagesAdded() throws Exception
QueueControl
resetMessagesAdded
in interface QueueControl
Exception
public void resetMessagesAcknowledged() throws Exception
QueueControl
resetMessagesAcknowledged
in interface QueueControl
Exception
public void resetMessagesExpired() throws Exception
QueueControl
resetMessagesExpired
in interface QueueControl
Exception
public void resetMessagesKilled() throws Exception
QueueControl
resetMessagesKilled
in interface QueueControl
Exception
public boolean isGroupRebalance()
QueueControl
isGroupRebalance
in interface QueueControl
public boolean isGroupRebalancePauseDispatch()
QueueControl
isGroupRebalancePauseDispatch
in interface QueueControl
public int getGroupBuckets()
QueueControl
getGroupBuckets
in interface QueueControl
public String getGroupFirstKey()
QueueControl
getGroupFirstKey
in interface QueueControl
public int getPreparedTransactionMessageCount()
QueueControl
getPreparedTransactionMessageCount
in interface QueueControl
Copyright © 2021 JBoss by Red Hat. All rights reserved.