Class QueueInfo

java.lang.Object
org.acemq.rabbitmq.admin.QueueInfo

public final class QueueInfo extends Object
A queue as the broker actually holds it.

This is the thing AMQP cannot give you. A passive declare says whether a queue exists; a real declare says whether your arguments match, by refusing when they do not. Neither reports what the arguments are, so a topology check over AMQP alone can say "this differs" and never "this is what it is".

Unknown fields are ignored deliberately. RabbitMQ adds fields to this endpoint between minor versions, and a client that failed on an unrecognised one would break on a broker upgrade it had no reason to care about.

  • Constructor Details

  • Method Details

    • name

      public String name()
      Returns:
      the queue's name
    • vhost

      public String vhost()
      Returns:
      the virtual host it lives in
    • type

      public String type()
      Returns:
      classic, quorum or stream
    • durable

      public boolean durable()
      Returns:
      whether it survives a broker restart
    • autoDelete

      public boolean autoDelete()
      Returns:
      whether the broker removes it when the last consumer goes
    • exclusive

      public boolean exclusive()
      Returns:
      whether it belongs to one connection
    • arguments

      public Map<String,Object> arguments()
      The arguments the queue was declared with.

      The reason this class exists. x-message-ttl, x-dead-letter-exchange, x-max-length and the rest, as the broker holds them rather than as anybody believes they were set.

      Returns:
      the arguments, never null
    • argument

      public Object argument(String name)
      Parameters:
      name - an argument's name
      Returns:
      its value, or null when the queue does not carry it
    • messages

      public long messages()
      Returns:
      total messages: ready plus unacknowledged
    • messagesReady

      public long messagesReady()
      Returns:
      messages waiting for a consumer.

      The number a queue-depth alert should use. messages() includes deliveries already handed to a consumer and not yet settled, so it stays high while a consumer works through a batch and says nothing about whether the queue is draining.

    • messagesUnacknowledged

      public long messagesUnacknowledged()
      Returns:
      messages delivered and not yet acknowledged
    • consumers

      public int consumers()
      Returns:
      how many consumers are attached
    • state

      public String state()
      Returns:
      running, idle, flow, or whatever the broker reported
    • toString

      public String toString()
      Overrides:
      toString in class Object