Sha256: e15481d8cf3428cf43c50a5d2e5016bbcdd99327fed0bc471dd0d7c18c4f7fc0
Contents?: true
Size: 988 Bytes
Versions: 3
Compression:
Stored size: 988 Bytes
Contents
# frozen_string_literal: true module Karafka module Web module Processing module Consumers # Fetches the current consumer processes aggregated state class State class << self # Fetch the current consumers state that is expected to exist # # @return [Hash] last (current) aggregated processes state def current! state_message = ::Karafka::Admin.read_topic( Karafka::Web.config.topics.consumers.states, 0, 1 ).last return state_message.payload if state_message raise(::Karafka::Web::Errors::Processing::MissingConsumersStateError) rescue Rdkafka::RdkafkaError => e raise(e) unless e.code == :unknown_partition raise(::Karafka::Web::Errors::Processing::MissingConsumersStatesTopicError) end end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems