public class QueueControlImpl extends AbstractControl implements QueueControl
Modifier and Type | Field and Description |
---|---|
static int |
FLUSH_LIMIT |
Constructor and Description |
---|
QueueControlImpl(Queue queue,
String address,
PostOffice postOffice,
StorageManager storageManager,
SecurityStore securityStore,
HierarchicalRepository<AddressSettings> addressSettingsRepository) |
Modifier and Type | Method and Description |
---|---|
CompositeData[] |
browse(String filterStr)
Resets the MessagesAdded property
|
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 |
countMessages(String filterStr)
Counts the number of messages in this queue matching the specified filter.
|
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.
|
String |
getAddress()
Returns the address this queue is bound to.
|
int |
getConsumerCount()
Returns the number of consumers consuming messages from this queue.
|
String |
getDeadLetterAddress()
Returns the dead-letter address associated with this queue.
|
int |
getDeliveringCount()
Returns the number of messages that this queue is currently delivering to its consumers.
|
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.
|
long |
getID()
Returns this queue ID.
|
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 |
getScheduledCount()
Returns the number of scheduled messages in this queue.
|
boolean |
isDurable()
Returns whether this queue is durable.
|
boolean |
isPaused()
Returns whether the queue is paused.
|
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 |
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.
|
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 |
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,
String userID,
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
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, PostOffice postOffice, 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 boolean isTemporary()
QueueControl
isTemporary
in interface QueueControl
public long getMessageCount()
QueueControl
getMessageCount
in interface QueueControl
public int getConsumerCount()
QueueControl
getConsumerCount
in interface QueueControl
public int getDeliveringCount()
QueueControl
getDeliveringCount
in interface QueueControl
public long getMessagesAdded()
QueueControl
getMessagesAdded
in interface QueueControl
public long getMessagesAcknowledged()
QueueControl
getMessagesAcknowledged
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 String getDeadLetterAddress()
QueueControl
getDeadLetterAddress
in interface QueueControl
public String getExpiryAddress()
QueueControl
getExpiryAddress
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(String filterStr) throws Exception
QueueControl
null
or an empty filter will count all messages from this queue.countMessages
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 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, String userID, 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(String filterStr) throws Exception
QueueControl
browse
in interface QueueControl
Exception
public void flushExecutor()
QueueControl
flushExecutor
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
Copyright © 2017 JBoss by Red Hat. All rights reserved.