Package org.acemq.amqp.core
Class ConsumerGroupBuilder<T>
java.lang.Object
org.acemq.amqp.core.ConsumerGroupBuilder<T>
- Type Parameters:
T- payload type
Says how many consumers to run and how much each may hold, and then starts them.
ConsumerGroup orders = mq.consumeGroup("orders.new", Order.class, handler)
.concurrency(4)
.prefetch(50)
.start();
Nothing consumes until start(). Every other method returns a new builder, so a
half-built one can be kept as a field or reused.
-
Method Summary
Modifier and TypeMethodDescriptionconcurrency(int concurrency) options(ConsumerOptions options) prefetch(int prefetch) start()toString()
-
Method Details
-
concurrency
- Parameters:
concurrency- how many consumers to run. More helps when handlers spend their time waiting on something else; it does nothing for a handler that is already CPU-bound- Returns:
- a builder with that concurrency
-
prefetch
- Parameters:
prefetch- how many messages each consumer may hold unacknowledged- Returns:
- a builder with that prefetch
-
options
- Parameters:
options- everything else about how the consumers behave — retries, idempotency, the codec to read with- Returns:
- a builder using them
-
start
- Returns:
- the running group
-
toString
-