qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Godfrey <rob.j.godf...@gmail.com>
Subject Re: [Qpid Java Broker] How to get the number of messages in a queue using REST api
Date Tue, 17 May 2016 10:55:42 GMT
Hi Adel,


within the JSON results object brought back for the queue is a "statistics"
section... here's an example from my local broker (running curl
http://localhost:8080/api/latest/queue/default/default/queue):

  "statistics" : {

    "bindingCount" : 0,

    "consumerCount" : 1,

    "consumerCountWithCredit" : 0,

    "oldestMessageAge" : 154793,

    "persistentDequeuedBytes" : 12,

    "persistentDequeuedMessages" : 1,

    "persistentEnqueuedBytes" : 45090,

    "persistentEnqueuedMessages" : 3006,

    "queueDepthBytes" : 45078,

    "queueDepthMessages" : 3005,

    "totalDequeuedBytes" : 12,

    "totalDequeuedMessages" : 1,

    "totalEnqueuedBytes" : 45090,

    "totalEnqueuedMessages" : 3006,

    "unacknowledgedBytes" : 1496,

    "unacknowledgedMessages" : 100

  }


The interesting fields here are "queueDepthMessages" which contains the
current number of messages the broker is holding on the queue, and
 "unacknowledgedMessages" which is the number of messages which are held by
the broker, but assigned to consumers already (so a new consumer attaching
to the queue will not be sent these messages unless the original consumer
releases them in some way).  In the above example this leaves 2905 messages
available on the queue for new consumers to receive.


Hope this helps,

Rob

On 16 May 2016 at 14:39, Adel Boutros <adelboutros@live.com> wrote:

> Hello,
> I was wondering how can I use the REST api of the Qpid Java Broker to get
> the number of messages which are currently in the broker and which any
> consumer can receive?
> From the web console, this is represented by the "depth" field of a queue,
> right?
> Regards,Adel

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message