Package org.acemq.workloads.scenario
Class ConsumerGroupNode
java.lang.Object
org.acemq.workloads.scenario.ConsumerGroupNode
- All Implemented Interfaces:
Node
The consumers on one queue.
Switching this off is not the same as removing it: the queue keeps filling and the run measures what a backlog costs, which is usually the question somebody had.
-
Method Summary
Modifier and TypeMethodDescriptionintconcurrency(int concurrency) enabled(boolean enabled) doublefailureRate(double fraction) handlerTime(Duration handlerTime) booleanname()none()pipeline()pipeline(String name, List<PipelineStage> steps) Consumes through a pipeline whose first step's queue is this one; seeConsumerSpec.pipeline(java.util.List).intprefetch()prefetch(int prefetch) How many unacknowledged messages each consumer may hold.org.acemq.amqp.api.RetryPolicyretry()retry(org.acemq.amqp.api.RetryPolicy policy) Retries failures on the library's ladder; seeConsumerSpec.retry.saga()Runs a saga for every message; seeConsumerSpec.saga.toString()
-
Method Details
-
concurrency
- Parameters:
concurrency- how many consumers on this queue- Returns:
- this group
-
prefetch
How many unacknowledged messages each consumer may hold.The number most often wrong in production, in both directions: too low and a consumer waits a round trip between messages; too high and one consumer takes work it cannot get through while others idle. Measuring is the only way to know which side you are on.
- Parameters:
prefetch- the window- Returns:
- this group
-
handlerTime
- Parameters:
handlerTime- how long the handler pretends to work for- Returns:
- this group
-
failureRate
- Parameters:
fraction- how often the handler throws, from 0 to 1- Returns:
- this group
-
enabled
- Parameters:
enabled- whether these consumers run- Returns:
- this group
-
none
- Returns:
- this group, switched off, so the queue grows
-
retry
Retries failures on the library's ladder; seeConsumerSpec.retry.- Parameters:
policy- the schedule, or null to dead-letter a failure on its first attempt- Returns:
- this node
-
retry
public org.acemq.amqp.api.RetryPolicy retry()- Returns:
- the retry policy, or null
-
saga
Runs a saga for every message; seeConsumerSpec.saga.- Parameters:
load- the saga's shape, or null for none- Returns:
- this node
-
saga
- Returns:
- the saga, or null
-
pipeline
Consumes through a pipeline whose first step's queue is this one; seeConsumerSpec.pipeline(java.util.List). The queue's name must be{name}.{first step}, which is the queue the library declares for it.- Parameters:
name- the pipeline's name, which is also its exchangesteps- the steps, in order, or empty for none- Returns:
- this node
-
pipelineName
- Returns:
- the pipeline's name, or null
-
pipeline
- Returns:
- the pipeline's steps, empty when there is none
-
name
-
queueName
- Returns:
- the queue these consumers read
-
concurrency
public int concurrency() -
prefetch
public int prefetch() -
handlerTime
-
failureRate
public double failureRate() -
isEnabled
public boolean isEnabled() -
toString
-