Sha256: f7dc862b6ed4cdb8cd464e465d3a639227435798b009dd6ebf79a9ab3e756ee9

Contents?: true

Size: 768 Bytes

Versions: 2

Compression:

Stored size: 768 Bytes

Contents

module NulogyMessageBusConsumer
  class Config
    attr_accessor :bootstrap_servers,
      :client_id,
      :consumer_group_id,
      :lag_check_interval_seconds,
      :lag_checks,
      :lag_timeout_milliseconds,
      :log_lag_interval_seconds,
      :prune_interval_seconds,
      :prune_max_age,
      :topic_name

    def initialize(options = {})
      defaults = {
        lag_check_interval_seconds: 20,
        lag_checks: 6,
        lag_timeout_milliseconds: 200,
        log_lag_interval_seconds: 1.minute.to_i,
        prune_interval_seconds: 1.hour.to_i,
        prune_max_age: 8.days
      }

      update(defaults.merge(options))
    end

    def update(options = {})
      options.each { |key, value| public_send("#{key}=", value) }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nulogy_message_bus_consumer-2.0.1 lib/nulogy_message_bus_consumer/config.rb
nulogy_message_bus_consumer-2.0.0 lib/nulogy_message_bus_consumer/config.rb