3 Replies Latest reply on Dec 4, 2017 12:19 PM by jbertram

    how did I get the messages (limit to top100) of queue

    baopingle

      When I using the hornetq API to list-messages of queue, it will list all messages, but how could I limit to top 100 messages, using filter?Could anyone give an example about it?

        • 1. Re: how did I get the messages (limit to top100) of queue
          jbertram

          You could use a filter to list a particular subset of messages which matched the filter, but there is no way to limit the list to the first X number of messages.

          • 2. Re: how did I get the messages (limit to top100) of queue
            baopingle

            Why I got the following error, I could run the cli command as "/subsystem=messaging/hornetq-server=default/jms-queue=ClusteredFirstDLQ/:list-messages-as-json(filter=JMSTimestamp > 1512350812632)" successfully?

             

            Caused by: com.agfa.csp.jms.operation.JBossControllerOperationException: "JBAS01

            4884: No operation named 'list-messages-as-json(filter=JMSTimestamp > 1512350812

            632)' exists at address [

                (\"subsystem\" => \"messaging\"),

                (\"hornetq-server\" => \"default\"),

                (\"jms-queue\" => \"ClusteredFirstDLQ\")

            ]" on 10.235.59.67

                    at com.agfa.csp.jms.operation.JBossControllerOps.getString(JBossControll

            • 3. Re: how did I get the messages (limit to top100) of queue
              jbertram

              This is more of a question for the Wildfly community as it appears to me that you're attempting to use the management API available via Wildfly.  That said, I don't recognize com.agfa.csp.jms.operation.JBossControllerOperationException.  That looks like custom exception, and I'm not sure where that would come from.

               

              For what it's worth, I just tried a similar CLI operation in Wildfly 10.1 (just the version I had on hand) and it worked fine.