rabbitmq-server icon indicating copy to clipboard operation
rabbitmq-server copied to clipboard

Could `enable_queue_totals` be allowed for `/api/queues/<vhost>/<name>`

Open ehaynes99 opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

Currently, for api/queues, the docs state:

The parameter enable_queue_totals=true can be used in combination with the disable_stats=true parameter to return a reduced set of fields and significantly reduce the amount of data returned by this endpoint. For /api/queues/<vhost>/<name>, the disable_stats flag works, but adding enable_queue_totals does not add the totals.

/api/queues with both options:

{
  "arguments": {},
  "auto_delete": false,
  "durable": true,
  "exclusive": false,
  "messages": 0,
  "messages_ready": 0,
  "messages_unacknowledged": 0,
  "name": "voice-notification-activity-c6op5ktn0x4",
  "node": "rabbit@op-rabbit",
  "state": "running",
  "type": "classic",
  "vhost": "/"
}

/api/queues/<vhost>/<name>:

{
  "arguments": {},
  "auto_delete": false,
  "durable": true,
  "exclusive": false,
  "name": "voice-notification-activity-c6op5ktn0x4",
  "node": "rabbit@op-rabbit",
  "state": "live",
  "type": "classic",
  "vhost": "/"
}

Describe the solution you'd like

Adding the enable_queue_totals option would include the message counts. I realize that the payload size is less of a consideration when fetching a single queue vs the list of queues, but since the disable_stats option is already implemented for this one, it would be nice to be able to use consistent types for these in application code.

Describe alternatives you've considered

No response

Additional context

No response

ehaynes99 avatar Jan 10 '24 19:01 ehaynes99

Tangentially related to: https://github.com/rabbitmq/rabbitmq-server/issues/9437

ehaynes99 avatar Jan 10 '24 19:01 ehaynes99

Yup, I don't see any justification for the difference, I suspect that virtual host-specific endpoint has just slipped through the cracks. Unfortunately I don't think we will get to work on this for at least several weeks.

michaelklishin avatar Jan 10 '24 20:01 michaelklishin

Hey, if anyone hasn't started on this issue yet, I'd be happy to take a look.

aaron-seo avatar Mar 21 '24 22:03 aaron-seo