HareMq.AutoScalerConfiguration (hare_mq v1.3.0)

Configuration module for HareMq AutoScaler.

This module provides functions for configuring the auto-scaler component of HareMq.

Summary

Functions

Structure representing the configuration for the auto-scaler.

Get the configuration for the auto-scaler.

Functions

Link to this function

%HareMq.AutoScalerConfiguration{}

(struct)

Structure representing the configuration for the auto-scaler.

Fields

  • :queue_name: The name of the queue to monitor.
  • :consumer_worker: The module to use for the consumer worker.
  • :module_name: The module whic use consumer_worker module.
  • :initial_consumer_count: The initial number of consumers to start.
  • :min_consumers: The minimum number of consumers to maintain.
  • :max_consumers: The maximum number of consumers to maintain.
  • :messages_per_consumer: The number of messages per consumer.
  • :check_interval: The interval (in milliseconds) at which to check the queue length.

Examples

config = %AutoScalerConfiguration{
  queue_name: "my_queue",
  consumer_worker: HareMq.Consumer,
  module_name: MyApp.Consumer,
  initial_consumer_count: 1,
  min_consumers: 1,
  max_consumers: 20,
  messages_per_consumer: 100,
  check_interval: 5_000
}
Link to this function

get_auto_scaler_configuration(list)

Get the configuration for the auto-scaler.

Examples

config = get_auto_scaler_configuration(
  queue_name: "my_queue",
  consumer_worker: MyApp.Consumer,
  consume: MyApp.Consumer
)