Sha256: 45210f00fb4409616bf0fe89e75cb14c6ddd2015242711ff04c8d1886d4f3b9d

Contents?: true

Size: 870 Bytes

Versions: 55

Compression:

Stored size: 870 Bytes

Contents

# frozen_string_literal: true

module Karafka
  module Routing
    # Default consumer mapper that builds consumer ids based on app id and consumer group name
    # Different mapper can be used in case of preexisting consumer names or for applying
    # other naming conventions not compatible with Karafka client_id + consumer name concept
    #
    # @example Mapper for using consumer groups without a client_id prefix
    #   class MyMapper
    #     def call(raw_consumer_group_name)
    #       raw_consumer_group_name
    #     end
    #   end
    class ConsumerMapper
      # @param raw_consumer_group_name [String, Symbol] string or symbolized consumer group name
      # @return [String] remapped final consumer group name
      def call(raw_consumer_group_name)
        "#{Karafka::App.config.client_id}_#{raw_consumer_group_name}"
      end
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
karafka-2.3.4 lib/karafka/routing/consumer_mapper.rb
karafka-2.3.3 lib/karafka/routing/consumer_mapper.rb
karafka-2.3.2 lib/karafka/routing/consumer_mapper.rb
karafka-2.3.1 lib/karafka/routing/consumer_mapper.rb
karafka-2.3.0 lib/karafka/routing/consumer_mapper.rb
karafka-2.3.0.rc1 lib/karafka/routing/consumer_mapper.rb
karafka-2.3.0.alpha2 lib/karafka/routing/consumer_mapper.rb
karafka-2.3.0.alpha1 lib/karafka/routing/consumer_mapper.rb
karafka-2.2.14 lib/karafka/routing/consumer_mapper.rb
karafka-2.2.13 lib/karafka/routing/consumer_mapper.rb
karafka-2.2.12 lib/karafka/routing/consumer_mapper.rb
karafka-2.2.11 lib/karafka/routing/consumer_mapper.rb
karafka-2.2.10 lib/karafka/routing/consumer_mapper.rb
karafka-2.2.9 lib/karafka/routing/consumer_mapper.rb
karafka-2.2.8 lib/karafka/routing/consumer_mapper.rb
karafka-2.2.8.beta1 lib/karafka/routing/consumer_mapper.rb
karafka-2.2.7 lib/karafka/routing/consumer_mapper.rb
karafka-2.2.6 lib/karafka/routing/consumer_mapper.rb
karafka-2.2.5 lib/karafka/routing/consumer_mapper.rb
karafka-2.2.4 lib/karafka/routing/consumer_mapper.rb