Class QueueNode
- All Implemented Interfaces:
Node
The consumers belong to the queue rather than to the scenario because that is where the interesting asymmetry lives: a fan-out with eight consumers on one queue and one on another is the shape that produces a backlog on exactly one leg, and a model with a single consumer block cannot describe it.
-
Method Summary
Modifier and TypeMethodDescriptionbindings()broker()The broker this queue actually lives on, when that is not the one the scenario runs against.classic()consumers(Consumer<ConsumerGroupNode> spec) deadLetterTo(String exchange) The arguments this queue is declared with, the type and dead-letter settings included.enabled(boolean enabled) What this queue is asked to prove.booleanbooleanbooleanisRemote()mirrored()A classic queue mirrored by an HA policy.name()quorum()stream()toString()type()
-
Method Details
-
classic
- Returns:
- this queue, as a classic queue
-
quorum
- Returns:
- this queue, as a quorum queue: replicated, durable, and slower by design
-
stream
- Returns:
- this queue, as a stream: an append-only log that consumers read at their own offset
-
mirrored
A classic queue mirrored by an HA policy.Only meaningful on RabbitMQ 3.13 and earlier. Mirrored classic queues were removed in 4.0 and quorum queues replaced them, so a scenario using this against a current broker gets a classic queue and a policy nothing honours — which is why the studio hides the option unless the broker it is pointed at is old enough to have it.
- Returns:
- this queue
-
type
- Parameters:
type- what kind of queue- Returns:
- this queue
-
boundTo
- Parameters:
exchange- where the messages come fromroutingKey- the pattern they arrive under- Returns:
- this queue
-
deadLetterTo
- Parameters:
exchange- where rejected and expired messages go- Returns:
- this queue
-
transient_
- Returns:
- this queue, not surviving a broker restart
-
argument
- Parameters:
name- a queue argument, such asx-max-lengthvalue- its value- Returns:
- this queue
-
broker
The broker this queue actually lives on, when that is not the one the scenario runs against.This is how a federation or shovel link gets measured. The link itself is broker configuration and this library does not declare it -- what it can do is stand on both ends of one: a producer publishes to the upstream broker, the link carries the messages, and a consumer group attached here reads them off the downstream queue. End-to-end latency for such a queue is therefore publish-to-arrival across the link, which is the number people actually want from federation and cannot get from either broker alone.
The measurement is sound because both ends run in this one process: the timestamp travels in the payload as a
System.nanoTime()reading, and nanoTime is only comparable within a JVM. Two copies of this tool on two machines would produce a difference between two unrelated clocks rather than a latency.A queue on another broker is never declared and its bindings are never created: the link owns that end, and declaring into it would either duplicate what the link already made or fail against an exchange that exists only upstream.
- Parameters:
url- the broker this queue is on, as an AMQP URL- Returns:
- this queue
-
enabled
- Parameters:
enabled- whether it takes part in the run- Returns:
- this queue
-
consumers
- Parameters:
spec- how many consumers, what prefetch, how slow the handler- Returns:
- this queue
-
name
-
type
-
isDurable
public boolean isDurable() -
deadLetterExchange
-
bindings
-
broker
- Returns:
- the broker this queue is on, or null for the one the scenario runs against
-
isRemote
public boolean isRemote()- Returns:
- whether this queue is on the far side of a link rather than on the run's broker
-
consumersNode
- Returns:
- the consumers attached to this queue, whether or not they are switched on
-
expect
What this queue is asked to prove..queue("orders.shipping", q -> q.quorum() .boundTo("orders", "order.*") .expect(e -> e.p99Below(Duration.ofMillis(50)).noBacklog(true)))- Parameters:
objectives- what to require of it- Returns:
- this queue
-
expectations
- Returns:
- what this queue is asked to prove, empty when nothing was asked
-
declaredArguments
The arguments this queue is declared with, the type and dead-letter settings included.- Returns:
- the arguments a declaration would carry
-
isEnabled
public boolean isEnabled() -
toString
-