Class ConsumerGroupNode

java.lang.Object
org.acemq.workloads.scenario.ConsumerGroupNode
All Implemented Interfaces:
Node

public final class ConsumerGroupNode extends Object implements 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 Details

    • concurrency

      public ConsumerGroupNode concurrency(int concurrency)
      Parameters:
      concurrency - how many consumers on this queue
      Returns:
      this group
    • prefetch

      public ConsumerGroupNode prefetch(int 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

      public ConsumerGroupNode handlerTime(Duration handlerTime)
      Parameters:
      handlerTime - how long the handler pretends to work for
      Returns:
      this group
    • failureRate

      public ConsumerGroupNode failureRate(double fraction)
      Parameters:
      fraction - how often the handler throws, from 0 to 1
      Returns:
      this group
    • enabled

      public ConsumerGroupNode enabled(boolean enabled)
      Parameters:
      enabled - whether these consumers run
      Returns:
      this group
    • none

      public ConsumerGroupNode none()
      Returns:
      this group, switched off, so the queue grows
    • name

      public String name()
      Specified by:
      name in interface Node
      Returns:
      what this node is called
    • queueName

      public String queueName()
      Returns:
      the queue these consumers read
    • concurrency

      public int concurrency()
    • prefetch

      public int prefetch()
    • handlerTime

      public Duration handlerTime()
    • failureRate

      public double failureRate()
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface Node
      Returns:
      whether it takes part in the run
    • toString

      public String toString()
      Overrides:
      toString in class Object