Interface QueueControl
public interface QueueControl
A QueueControl is used to manage a queue.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionbrowse()browse(int page, int pageSize) booleanchangeMessagePriority(long messageID, int newPriority) Changes the message's priority corresponding to the specified message ID to the specified priority.intchangeMessagesPriority(String filter, int newPriority) Changes the priority for all the message corresponding to the specified filter to the specified priority.booleancopyMessage(long messageID, String targetQueue) longcountDeliveringMessages(String filter) Counts the number of delivering messages in this queue matching the specified filter.countDeliveringMessages(String filter, String groupByProperty) Counts the number of delivering messages in this queue matching the specified filter, grouped by the given property field.longlongcountMessages(String filter) Counts the number of messages in this queue matching the specified filter.countMessages(String filter, String groupByProperty) Counts the number of messages in this queue matching the specified filter, grouped by the given property field.voiddeliverScheduledMessage(long messageId) Deliver the scheduled message with the specified message IDvoiddeliverScheduledMessages(String filter) Deliver the scheduled messages which match the filtervoiddisable()Enables the queue.voidenable()Enables the queue.booleanexpireMessage(long messageID) Expires the message corresponding to the specified message ID.intexpireMessages(String filter) Expires all the message corresponding to the specified filter.voidit will flush one cycle on internal executors, so you would be sure that any pending tasks are done before you call any other measure.longReturns the number of messages added to this queue since it was created.Returns the address this queue is bound to.intReturns the number of consumers consuming messages from this queue.intReturns the Consumers Before Dispatch.Returns the dead-letter address associated with this queue.longReturns the Delay Before Dispatch.intReturns the number of messages that this queue is currently delivering to its consumers.longReturns the persistent size of messages that this queue is currently delivering to its consumers.intReturns the number of durable messages that this queue is currently delivering to its consumers.longReturns the size of durable messages that this queue is currently delivering to its consumers.longReturns the number of durable messages currently in this queue.longReturns the persistent size of durable messages currently in this queue; the persistent size of a message is the amount of space the message would take up on disk which is used to track how much data there is to consume on this queue.longReturns the number of durable scheduled messages in this queue.longReturns the size of durable scheduled messages in this queue.Returns the expiry address associated with this queue.Returns the filter associated with this queue.Returns the age of the first message in milliseconds.Returns the first message on the queue as JSON.Returns the timestamp of the first message in milliseconds.intWill return the group buckets.intWill return the current number of active groups.Will return the header key to notify a consumer of a group change.longgetID()Returns this queue ID.Returns key used for the last value queues.intlongReturns the number of messages currently in this queue.longReturns the number of messages added to this queue since it was created.longReturns the number of messages added to this queue since it was created.longReturns the number of messages expired from this queue since it was created.longReturns the number of messages removed from this queue since it was created due to exceeding the max delivery attempts.getName()Returns the name of this queue.longReturns the persistent size of all messages currently in this queue; the persistent size of a message is the amount of space the message would take up on disk which is used to track how much data there is to consume on this queue.intWill return the number of messages stuck in prepared transactionslongWill return the ring size.The routing type of this queue.longReturns the number of scheduled messages in this queue.longReturns the size of scheduled messages in this queue.getUser()Returns the user that is associated with creating the queue.booleanReturns whether this queue is available for auto deletion.booleanbooleanReturns whether this queue is durable.booleanbooleanbooleanReturns whether the groups of this queue are automatically rebalanced.booleanReturns whether the dispatch is paused when groups of this queue are automatically rebalanced.booleanReturns whether this queue was created for the broker's internal use.booleanbooleanisPaused()Returns whether the queue is paused.booleanReturns whether the queue's paused status is persisted.booleanbooleanReturns whether this queue is used for a retroactive address.booleanReturns whether this queue is temporary.Lists all the messages being deliver per consumer.Executes a conversion oflistDeliveringMessages()to JSONLists the message counter for this queue.Lists the message counter for this queue as a HTML table.Lists the message counter history for this queue.Deprecated.listMessages(String filter) Lists all the messages in this queue matching the specified filter.listMessagesAsJSON(String filter) Lists all the messages in this queue matching the specified filter using JSON serialization.Lists all the messages scheduled for delivery for this queue.Lists all the messages scheduled for delivery for this queue using JSON serialization.booleanmoveMessage(long messageID, String otherQueueName) Moves the message corresponding to the specified message ID to the specified other queue.booleanmoveMessage(long messageID, String otherQueueName, boolean rejectDuplicates) Moves the message corresponding to the specified message ID to the specified other queue.intmoveMessages(int flushLimit, String filter, String otherQueueName, boolean rejectDuplicates) intmoveMessages(int flushLimit, String filter, String otherQueueName, boolean rejectDuplicates, int messageCount) intmoveMessages(String filter, String otherQueueName) Moves all the message corresponding to the specified filter to the specified other queue.intmoveMessages(String filter, String otherQueueName, boolean rejectDuplicates) Moves all the message corresponding to the specified filter to the specified other queue.voidpause()Pauses the queue.voidpause(boolean persist) Pauses the queue.Returns the first message on the queue as JSON.Returns the first scheduled message on the queue as JSON.intRemoves all the message from the queue.booleanremoveMessage(long messageID) Removes the message corresponding to the specified message ID.intremoveMessages(int flushLimit, String filter) Removes all the message corresponding to the specified filter.intremoveMessages(String filter) Removes all the message corresponding to the specified filter.voidWill reset the all the groups.voidresetGroup(String groupID) Will reset the group matching the given groupID.voidResets the message counter for this queue.voidResets the MessagesAdded propertyvoidResets the MessagesAdded propertyvoidResets the MessagesExpired propertyvoidResets the MessagesExpired propertyvoidresume()Resumes the queue.booleanretryMessage(long messageID) Retries the message corresponding to the given messageID to the original queue.intRetries all messages on a DLQ to their respective original queues.sendMessage(Map<String, String> headers, int type, String body, boolean durable, String user, String password) Sends a TextMessage to a password-protected destination.sendMessage(Map<String, String> headers, int type, String body, boolean durable, String user, String password, boolean createMessageId) Sends a TextMessage to a password-protected destination.intsendMessagesToDeadLetterAddress(String filterStr) Sends all the message corresponding to the specified filter to this queue's dead letter address.booleansendMessageToDeadLetterAddress(long messageID) Sends the message corresponding to the specified message ID to this queue's dead letter address.
-
Field Details
-
MESSAGE_COUNT_DESCRIPTION
- See Also:
-
DURABLE_MESSAGE_COUNT_DESCRIPTION
- See Also:
-
PERSISTENT_SIZE_DESCRIPTION
- See Also:
-
DURABLE_PERSISTENT_SIZE_DESCRIPTION
- See Also:
-
SCHEDULED_MESSAGE_COUNT_DESCRIPTION
- See Also:
-
DURABLE_SCHEDULED_MESSAGE_COUNT_DESCRIPTION
- See Also:
-
SCHEDULED_SIZE_DESCRIPTION
- See Also:
-
DURABLE_SCHEDULED_SIZE_DESCRIPTION
- See Also:
-
DELIVERING_MESSAGE_COUNT_DESCRIPTION
- See Also:
-
DURABLE_DELIVERING_MESSAGE_COUNT_DESCRIPTION
- See Also:
-
DELIVERING_SIZE_DESCRIPTION
- See Also:
-
DURABLE_DELIVERING_SIZE_DESCRIPTION
- See Also:
-
CONSUMER_COUNT_DESCRIPTION
- See Also:
-
MESSAGES_ADDED_DESCRIPTION
- See Also:
-
MESSAGES_ACKNOWLEDGED_DESCRIPTION
- See Also:
-
MESSAGES_EXPIRED_DESCRIPTION
- See Also:
-
MESSAGES_KILLED_DESCRIPTION
- See Also:
-
-
Method Details
-
getName
-
getAddress
String getAddress()Returns the address this queue is bound to.- Returns:
- the address this queue is bound to
-
getID
long getID()Returns this queue ID.- Returns:
- this queue ID
-
isTemporary
boolean isTemporary()Returns whether this queue is temporary.- Returns:
- whether this queue is temporary
-
isRetroactiveResource
boolean isRetroactiveResource()Returns whether this queue is used for a retroactive address.- Returns:
- whether this queue is used for a retroactive address
-
isDurable
boolean isDurable()Returns whether this queue is durable.- Returns:
- whether this queue is durable
-
getUser
String getUser()Returns the user that is associated with creating the queue.- Returns:
- the user that is associated with creating the queue
-
getRoutingType
String getRoutingType()The routing type of this queue. -
getFilter
String getFilter()Returns the filter associated with this queue.- Returns:
- the filter associated with this queue
-
getMessageCount
long getMessageCount()Returns the number of messages currently in this queue.- Returns:
- the number of messages currently in this queue
-
getPersistentSize
long getPersistentSize()Returns the persistent size of all messages currently in this queue; the persistent size of a message is the amount of space the message would take up on disk which is used to track how much data there is to consume on this queue.- Returns:
- the persistent size of all messages currently in this queue; the persistent size of a message is the amount of space the message would take up on disk which is used to track how much data there is to consume on this queue
-
getDurableMessageCount
long getDurableMessageCount()Returns the number of durable messages currently in this queue.- Returns:
- the number of durable messages currently in this queue
-
getDurablePersistentSize
long getDurablePersistentSize()Returns the persistent size of durable messages currently in this queue; the persistent size of a message is the amount of space the message would take up on disk which is used to track how much data there is to consume on this queue.- Returns:
- the persistent size of durable messages currently in this queue; the persistent size of a message is the amount of space the message would take up on disk which is used to track how much data there is to consume on this queue
-
isInternalQueue
boolean isInternalQueue()Returns whether this queue was created for the broker's internal use.- Returns:
- whether this queue was created for the broker's internal use
-
getScheduledCount
long getScheduledCount()Returns the number of scheduled messages in this queue.- Returns:
- the number of scheduled messages in this queue
-
getScheduledSize
long getScheduledSize()Returns the size of scheduled messages in this queue.- Returns:
- the size of scheduled messages in this queue
-
getDurableScheduledCount
long getDurableScheduledCount()Returns the number of durable scheduled messages in this queue.- Returns:
- the number of durable scheduled messages in this queue
-
getDurableScheduledSize
long getDurableScheduledSize()Returns the size of durable scheduled messages in this queue.- Returns:
- the size of durable scheduled messages in this queue
-
getConsumerCount
int getConsumerCount()Returns the number of consumers consuming messages from this queue.- Returns:
- the number of consumers consuming messages from this queue
-
getDeliveringCount
int getDeliveringCount()Returns the number of messages that this queue is currently delivering to its consumers.- Returns:
- the number of messages that this queue is currently delivering to its consumers
-
getDeliveringSize
long getDeliveringSize()Returns the persistent size of messages that this queue is currently delivering to its consumers.- Returns:
- the persistent size of messages that this queue is currently delivering to its consumers
-
getDurableDeliveringCount
int getDurableDeliveringCount()Returns the number of durable messages that this queue is currently delivering to its consumers.- Returns:
- the number of durable messages that this queue is currently delivering to its consumers
-
getDurableDeliveringSize
long getDurableDeliveringSize()Returns the size of durable messages that this queue is currently delivering to its consumers.- Returns:
- the size of durable messages that this queue is currently delivering to its consumers
-
getMessagesAdded
long getMessagesAdded()Returns the number of messages added to this queue since it was created.- Returns:
- the number of messages added to this queue since it was created
-
getMessagesAcknowledged
long getMessagesAcknowledged()Returns the number of messages added to this queue since it was created.- Returns:
- the number of messages added to this queue since it was created
-
getAcknowledgeAttempts
long getAcknowledgeAttempts()Returns the number of messages added to this queue since it was created.- Returns:
- the number of messages added to this queue since it was created
-
getMessagesExpired
long getMessagesExpired()Returns the number of messages expired from this queue since it was created.- Returns:
- the number of messages expired from this queue since it was created
-
getMessagesKilled
long getMessagesKilled()Returns the number of messages removed from this queue since it was created due to exceeding the max delivery attempts.- Returns:
- the number of messages removed from this queue since it was created due to exceeding the max delivery attempts
-
getFirstMessageAsJSON
-
getFirstMessageTimestamp
-
getFirstMessageAge
-
getExpiryAddress
String getExpiryAddress()Returns the expiry address associated with this queue.- Returns:
- the expiry address associated with this queue
-
getDeadLetterAddress
String getDeadLetterAddress()Returns the dead-letter address associated with this queue.- Returns:
- the dead-letter address associated with this queue
-
getMaxConsumers
int getMaxConsumers() -
isPurgeOnNoConsumers
boolean isPurgeOnNoConsumers() -
isEnabled
boolean isEnabled() -
enable
-
disable
-
isConfigurationManaged
boolean isConfigurationManaged() -
isExclusive
boolean isExclusive() -
isLastValue
boolean isLastValue() -
getLastValueKey
String getLastValueKey()Returns key used for the last value queues.- Returns:
- key used for the last value queues
-
getConsumersBeforeDispatch
int getConsumersBeforeDispatch()Returns the Consumers Before Dispatch.- Returns:
- the Consumers Before Dispatch
-
getDelayBeforeDispatch
long getDelayBeforeDispatch()Returns the Delay Before Dispatch.- Returns:
- the Delay Before Dispatch
-
listScheduledMessages
-
listScheduledMessagesAsJSON
-
listDeliveringMessages
Lists all the messages being deliver per consumer.The Map's key is a toString representation for the consumer. Each consumer will then return a
Map<String,Object>[]same way is returned bylistScheduledMessages()- Throws:
Exception
-
listDeliveringMessagesAsJSON
Executes a conversion oflistDeliveringMessages()to JSON- Throws:
Exception
-
listMessages
Lists all the messages in this queue matching the specified filter.1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
Using
nullor an empty filter will list all messages from this queue.- Throws:
Exception
-
listMessagesAsJSON
-
countMessages
-
countMessages
-
countMessages
Counts the number of messages in this queue matching the specified filter, grouped by the given property field. In case of null property will be grouped in "null"Using
nullor an empty filter will count all messages from this queue.- Throws:
Exception
-
countDeliveringMessages
-
countDeliveringMessages
Counts the number of delivering messages in this queue matching the specified filter, grouped by the given property field. In case of null property will be grouped in "null"Using
nullor an empty filter will count all messages from this queue.- Throws:
Exception
-
removeMessage
-
removeMessages
-
removeMessages
-
removeAllMessages
-
expireMessages
-
expireMessage
-
retryMessage
-
retryMessages
-
moveMessage
-
moveMessage
-
moveMessages
Moves all the message corresponding to the specified filter to the specified other queue. RejectDuplicates = false on this caseUsing
nullor an empty filter will move all messages from this queue.- Returns:
- the number of moved messages
- Throws:
Exception
-
moveMessages
Moves all the message corresponding to the specified filter to the specified other queue.Using
nullor an empty filter will move all messages from this queue.- Returns:
- the number of moved messages
- Throws:
Exception
-
moveMessages
-
moveMessages
-
copyMessage
-
sendMessageToDeadLetterAddress
-
sendMessagesToDeadLetterAddress
-
sendMessage
String sendMessage(Map<String, String> headers, int type, String body, boolean durable, String user, String password) throws ExceptionSends a TextMessage to a password-protected destination.- Parameters:
headers- the message headers and properties to set. Can only container Strings maped to primitive types.body- the text to send- Throws:
Exception
-
sendMessage
String sendMessage(Map<String, String> headers, int type, String body, boolean durable, String user, String password, boolean createMessageId) throws ExceptionSends a TextMessage to a password-protected destination.- Parameters:
headers- the message headers and properties to set. Can only container Strings maped to primitive types.body- the text to sendcreateMessageId- whether to auto generate a Message ID- Throws:
Exception
-
changeMessagePriority
Changes the message's priority corresponding to the specified message ID to the specified priority.- Parameters:
newPriority- between 0 and 9 inclusive.- Returns:
trueif the message priority was changed- Throws:
Exception
-
changeMessagesPriority
Changes the priority for all the message corresponding to the specified filter to the specified priority.Using
nullor an empty filter will change all messages from this queue.- Returns:
- the number of changed messages
- Throws:
Exception
-
listMessageCounter
-
resetMessageCounter
-
listMessageCounterAsHTML
-
listMessageCounterHistory
-
listMessageCounterHistoryAsHTML
-
pause
-
pause
-
resume
-
listConsumersAsJSON
-
isPaused
boolean isPaused()Returns whether the queue is paused.- Returns:
- whether the queue is paused
-
isPersistedPause
boolean isPersistedPause()Returns whether the queue's paused status is persisted.- Returns:
- whether the queue's paused status is persisted
-
browse
- Throws:
Exception
-
browse
- Throws:
Exception
-
browse
- Throws:
Exception
-
browse
- Throws:
Exception
-
resetMessagesAdded
-
resetMessagesAcknowledged
-
resetMessagesExpired
-
resetMessagesKilled
-
flushExecutor
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. It is useful if you need the exact number of counts on a message -
resetAllGroups
void resetAllGroups()Will reset the all the groups. This is useful if you want a complete rebalance of the groups to consumers -
resetGroup
Will reset the group matching the given groupID. This is useful if you want the given group to be rebalanced to the consumers -
getGroupCount
int getGroupCount()Will return the current number of active groups. -
listGroupsAsJSON
-
getRingSize
long getRingSize()Will return the ring size. -
isGroupRebalance
boolean isGroupRebalance()Returns whether the groups of this queue are automatically rebalanced.- Returns:
- whether the groups of this queue are automatically rebalanced
-
isGroupRebalancePauseDispatch
boolean isGroupRebalancePauseDispatch()Returns whether the dispatch is paused when groups of this queue are automatically rebalanced.- Returns:
- whether the dispatch is paused when groups of this queue are automatically rebalanced
-
getGroupBuckets
int getGroupBuckets()Will return the group buckets. -
getGroupFirstKey
String getGroupFirstKey()Will return the header key to notify a consumer of a group change. -
getPreparedTransactionMessageCount
int getPreparedTransactionMessageCount()Will return the number of messages stuck in prepared transactions -
deliverScheduledMessages
-
deliverScheduledMessage
-
isAutoDelete
boolean isAutoDelete()Returns whether this queue is available for auto deletion.- Returns:
- whether this queue is available for auto deletion
-
peekFirstMessageAsJSON
-
peekFirstScheduledMessageAsJSON
-