org.apache.activemq.artemis.api.jms.management

## Interface JMSQueueControl

- All Superinterfaces:
    DestinationControl
  All Known Implementing Classes:
    JMSQueueControlImpl

      public interface JMSQueueControl
      extends DestinationControl

  A JMSQueueControl is used to manage a JMS queue.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addBinding(String binding)` Add the JNDI binding to this destination
    `boolean` | `changeMessagePriority(String messageID, int newPriority)` Changes the message's priority corresponding to the specified message ID to the specified priority.
    `int` | `changeMessagesPriority(String filter, int newPriority)` Changes the priority for all the message corresponding to the specified filter to the specified priority.
    `long` | `countMessages(String filter)` Counts the number of messages in this queue matching the specified filter.
    `boolean` | `expireMessage(String messageID)` Expires the message corresponding to the specified message ID.
    `int` | `expireMessages(String filter)` Expires all the message corresponding to the specified filter.
    `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.
    `int` | `getConsumerCount()` Returns the number of consumers consuming messages from this queue.
    `String` | `getDeadLetterAddress()` Returns the dead-letter address associated to this queue.
    `String` | `getExpiryAddress()` Returns the expiry address associated to this queue.
    `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.
    `String[]` | `getRegistryBindings()` Returns the Registry bindings associated to this connection factory.
    `long` | `getScheduledCount()` Returns the number of scheduled messages in this queue.
    `String` | `getSelector()` returns the selector for the queue
    `boolean` | `isPaused()` Returns whether the queue is paused.
    `String` | `listConsumersAsJSON()`
    `Map<String,Map<String,Object>[]>` | `listDeliveringMessages()` Lists all the messages being deliver per consumer.
    `String` | `listDeliveringMessagesAsJSON()` Executes a conversion of `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 filter)` Lists all the JMS messages in this queue matching the specified filter.
    `String` | `listMessagesAsJSON(String filter)` Lists all the JMS 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(String messageID, String otherQueueName)` Moves the message corresponding to the specified message ID to the specified other queue.
    `boolean` | `moveMessage(String messageID, String otherQueueName, boolean rejectDuplicates)` Moves the message corresponding to the specified message ID to the specified other queue.
    `int` | `moveMessages(String filter, String otherQueueName)` Moves all the message corresponding to the specified filter to the specified other queue.
    `int` | `moveMessages(String filter, String otherQueueName, boolean rejectDuplicates)` Moves all the message corresponding to the specified filter to the specified other queue.
    `void` | `pause()` Pauses the queue.
    `boolean` | `removeMessage(String messageID)` Removes the message corresponding to the specified message ID.
    `int` | `removeMessages(String filter)` Removes all the message corresponding to the specified filter.
    `void` | `resetMessageCounter()` Resets the message counter for this queue.
    `void` | `resume()` Resumes the queue.
    `int` | `sendMessagesToDeadLetterAddress(String filterStr)` Sends all the message corresponding to the specified filter to this queue's dead letter address.
    `boolean` | `sendMessageToDeadLetterAddress(String messageID)` Sends the message corresponding to the specified message ID to this queue's dead letter address.

    - ### Methods inherited from interface org.apache.activemq.artemis.api.jms.management.DestinationControl

      `getAddress, getDeliveringCount, getMessageCount, getMessagesAdded, getName, isTemporary`

- - ### Method Detail

    - #### getExpiryAddress

          String getExpiryAddress()

      Returns the expiry address associated to this queue.

    - #### getDeadLetterAddress

          String getDeadLetterAddress()

      Returns the dead-letter address associated to this queue.

    - #### getScheduledCount

          long getScheduledCount()

      Returns the number of scheduled messages in this queue.

    - #### getConsumerCount

          int getConsumerCount()

      Returns the number of consumers consuming messages from this queue.

    - #### getSelector

          String getSelector()

      returns the selector for the queue

    - #### getFirstMessageAsJSON

          String getFirstMessageAsJSON()
                                throws Exception

      Returns the first message on the queue as JSON
      Throws:
        `Exception`

    - #### getFirstMessageTimestamp

          Long getFirstMessageTimestamp()
                                 throws Exception

      Returns the timestamp of the first message in milliseconds.
      Throws:
        `Exception`

    - #### getFirstMessageAge

          Long getFirstMessageAge()
                           throws Exception

      Returns the age of the first message in milliseconds.
      Throws:
        `Exception`

    - #### getRegistryBindings

          String[] getRegistryBindings()

      Returns the Registry bindings associated to this connection factory.

    - #### addBinding

          void addBinding(String binding)
                   throws Exception

      Add the JNDI binding to this destination
      Throws:
        `Exception`

    - #### listMessages

          Map<String,Object>[] listMessages(String filter)
                                     throws Exception

      Lists all the JMS 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 `null` or an empty filter will list all messages from this queue.
      Throws:
        `Exception`

    - #### listMessagesAsJSON

          String listMessagesAsJSON(String filter)
                             throws Exception

      Lists all the JMS messages in this queue matching the specified filter using JSON serialization.
      Using `null` or an empty filter will list all messages from this queue.
      Throws:
        `Exception`

    - #### countMessages

          long countMessages(String filter)
                      throws Exception

      Counts the number of messages in this queue matching the specified filter.
      Using `null` or an empty filter will count all messages from this queue.
      Throws:
        `Exception`

    - #### removeMessage

          boolean removeMessage(String messageID)
                         throws Exception

      Removes the message corresponding to the specified message ID.
      Returns:
        `true` if the message was removed, `false` else
      Throws:
        `Exception`

    - #### removeMessages

          int removeMessages(String filter)
                      throws Exception

      Removes all the message corresponding to the specified filter.
      Using `null` or an empty filter will remove all messages from this queue.
      Specified by:
        `removeMessages` in interface `DestinationControl`
      Returns:
        the number of removed messages
      Throws:
        `Exception`

    - #### expireMessages

          int expireMessages(String filter)
                      throws Exception

      Expires all the message corresponding to the specified filter.
      Using `null` or an empty filter will expire all messages from this queue.
      Returns:
        the number of expired messages
      Throws:
        `Exception`

    - #### expireMessage

          boolean expireMessage(String messageID)
                         throws Exception

      Expires the message corresponding to the specified message ID.
      Returns:
        `true` if the message was expired, `false` else
      Throws:
        `Exception`

    - #### sendMessageToDeadLetterAddress

          boolean sendMessageToDeadLetterAddress(String messageID)
                                          throws Exception

      Sends the message corresponding to the specified message ID to this queue's dead letter address.
      Returns:
        `true` if the message was sent to the dead letter address, `false` else
      Throws:
        `Exception`

    - #### sendMessagesToDeadLetterAddress

          int sendMessagesToDeadLetterAddress(String filterStr)
                                       throws Exception

      Sends all the message corresponding to the specified filter to this queue's dead letter address.
      Using `null` or an empty filter will send all messages from this queue.
      Returns:
        the number of sent messages
      Throws:
        `Exception`

    - #### changeMessagePriority

          boolean changeMessagePriority(String messageID,
                                        int newPriority)
                                 throws Exception

      Changes the message's priority corresponding to the specified message ID to the specified priority.
      Parameters:
        `newPriority` - between 0 and 9 inclusive.
      Returns:
        `true` if the message priority was changed
      Throws:
        `Exception`

    - #### changeMessagesPriority

          int changeMessagesPriority(String filter,
                                     int newPriority)
                              throws Exception

      Changes the priority for all the message corresponding to the specified filter to the specified priority.
      Using `null` or an empty filter will change all messages from this queue.
      Returns:
        the number of changed messages
      Throws:
        `Exception`

    - #### moveMessage

          boolean moveMessage(String messageID,
                              String otherQueueName)
                       throws Exception

      Moves the message corresponding to the specified message ID to the specified other queue.
      Returns:
        `true` if the message was moved, `false` else
      Throws:
        `Exception`

    - #### moveMessage

          boolean moveMessage(String messageID,
                              String otherQueueName,
                              boolean rejectDuplicates)
                       throws Exception

      Moves the message corresponding to the specified message ID to the specified other queue.
      Returns:
        `true` if the message was moved, `false` else
      Throws:
        `Exception`

    - #### moveMessages

          int moveMessages(String filter,
                           String otherQueueName)
                    throws Exception

      Moves all the message corresponding to the specified filter to the specified other queue. RejectDuplicates=false on this case
      Using `null` or an empty filter will move all messages from this queue.
      Returns:
        the number of moved messages
      Throws:
        `Exception`

    - #### moveMessages

          int moveMessages(String filter,
                           String otherQueueName,
                           boolean rejectDuplicates)
                    throws Exception

      Moves all the message corresponding to the specified filter to the specified other queue.
      Using `null` or an empty filter will move all messages from this queue.
      Returns:
        the number of moved messages
      Throws:
        `Exception`

    - #### listMessageCounter

          String listMessageCounter()
                             throws Exception

      Lists the message counter for this queue.
      Throws:
        `Exception`

    - #### resetMessageCounter

          void resetMessageCounter()
                            throws Exception

      Resets the message counter for this queue.
      Throws:
        `Exception`

    - #### listMessageCounterAsHTML

          String listMessageCounterAsHTML()
                                   throws Exception

      Lists the message counter for this queue as a HTML table.
      Throws:
        `Exception`

    - #### listMessageCounterHistory

          String listMessageCounterHistory()
                                    throws Exception

      Lists the message counter history for this queue.
      Throws:
        `Exception`

    - #### listMessageCounterHistoryAsHTML

          String listMessageCounterHistoryAsHTML()
                                          throws Exception

      Lists the message counter history for this queue as a HTML table.
      Throws:
        `Exception`

    - #### pause

          void pause()
              throws Exception

      Pauses the queue. Messages are no longer delivered to its consumers.
      Throws:
        `Exception`

    - #### isPaused

          boolean isPaused()
                    throws Exception

      Returns whether the queue is paused.
      Throws:
        `Exception`

    - #### resume

          void resume()
               throws Exception

      Resumes the queue. Messages are again delivered to its consumers.
      Throws:
        `Exception`

    - #### listConsumersAsJSON

          String listConsumersAsJSON()
                              throws Exception

      Throws:
        `Exception`

    - #### 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

    - #### listScheduledMessages

          Map<String,Object>[] listScheduledMessages()
                                              throws Exception

      Lists all the messages scheduled for delivery for this queue.
      1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
      Throws:
        `Exception`

    - #### listScheduledMessagesAsJSON

          String listScheduledMessagesAsJSON()
                                      throws Exception

      Lists all the messages scheduled for delivery for this queue using JSON serialization.
      Throws:
        `Exception`

    - #### listDeliveringMessages

          Map<String,Map<String,Object>[]> listDeliveringMessages()
                                                           throws Exception

      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 by `listScheduledMessages()`
      Throws:
        `Exception`

    - #### listDeliveringMessagesAsJSON

          String listDeliveringMessagesAsJSON()
                                       throws Exception

      Executes a conversion of `listDeliveringMessages()` to JSON
      Returns:
      Throws:
        `Exception`

Copyright © 2016. All rights reserved.