Class QueueInfo
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
-
QueueInfo
-
-
Method Details
-
name
- Returns:
- the queue's name
-
vhost
- Returns:
- the virtual host it lives in
-
type
- Returns:
classic,quorumorstream
-
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
The arguments the queue was declared with.The reason this class exists.
x-message-ttl,x-dead-letter-exchange,x-max-lengthand the rest, as the broker holds them rather than as anybody believes they were set.- Returns:
- the arguments, never null
-
argument
- 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
- Returns:
running,idle,flow, or whatever the broker reported
-
toString
-