1 Reply Latest reply on Apr 8, 2013 9:18 AM by Justin Bertram

    Access to JMS management APIs in JBoss AS7.1

    slrslr Newbie

      Hello,

       

      I am using JBoss AS 7.1 in domain mode.

      I am trying to play with JMS management APIs to delete messages from a queue, and/or move them from a queue to another one.

       

      The APIs seem to have been moving quite a lot in the last couple of years and I am not able to find some working, either in CLI mode or programmatically with JMX.

       

      I had a look at this topic:

      https://community.jboss.org/thread/197030

       

      which tells about a "remove-messages" operation in Jboss 7.

       

      If I go in the path of my queue and try to list all available operations in the CLI:

       

      [domain@localhost:6999 /] cd /host=master/server=server1/subsystem=messaging/hornetq-server=default/jms-queue=queue1/

      [domain@localhost:6999 jms-queue=queue1]:read-operation-names

      {

          "outcome" => "success",

          "result" => [

              "count-messages",

              "list-consumers-as-json",

              "list-message-counter-as-html",

              "list-message-counter-as-json",

              "list-message-counter-history-as-html",

              "list-message-counter-history-as-json",

              "list-messages",

              "list-messages-as-json",

              "read-attribute",

              "read-children-names",

              "read-children-resources",

              "read-children-types",

              "read-operation-description",

              "read-operation-names",

              "read-resource",

              "read-resource-description"

          ]

      }

       

      I have no management operation available, especially not the "remove-messages" mentioned in the other topic. Programmatically, same issue, the Java API "org.hornetq.api.jms.management.JMSQueueControl.removeMessage" seems to launch an operation that is not existing.

       

      Do you know if the CLI changed on this point between 7.0 and 7.1 ?

      Or is there a configuration to change to activate/give rights to use management actions on the JMS queues ?

      In any case, has someone an idea on the right way to do this ?

       

      Thank you in advance.

      Cheers.

        • 1. Re: Access to JMS management APIs in JBoss AS7.1
          Justin Bertram Master

          Yes, the management API has changed.  Here's what I get in AS 7.1.2:

           

          [standalone@localhost:9999 /] cd subsystem=messaging/hornetq-server=default
          [standalone@localhost:9999 hornetq-server=default] cd jms-queue=myqueue
          [standalone@localhost:9999 jms-queue=myqueue] :read-operation-names
          {
              "outcome" => "success",
              "result" => [
                  "add",
                  "add-jndi",
                  "change-message-priority",
                  "change-messages-priority",
                  "count-messages",
                  "expire-message",
                  "expire-messages",
                  "list-consumers-as-json",
                  "list-message-counter-as-html",
                  "list-message-counter-as-json",
                  "list-message-counter-history-as-html",
                  "list-message-counter-history-as-json",
                  "list-messages",
                  "list-messages-as-json",
                  "move-message",
                  "move-messages",
                  "pause",
                  "read-attribute",
                  "read-children-names",
                  "read-children-resources",
                  "read-children-types",
                  "read-operation-description",
                  "read-operation-names",
                  "read-resource",
                  "read-resource-description",
                  "remove",
                  "remove-message",
                  "remove-messages",
                  "reset-message-counter",
                  "resume",
                  "send-message-to-dead-letter-address",
                  "send-messages-to-dead-letter-address",
                  "undefine-attribute",
                  "whoami",
                  "write-attribute"
              ]
          }