Module: Karafka::Pro::Routing::Features::Patterns::Builder

Defined in:
lib/karafka/pro/routing/features/patterns/builder.rb

Overview

Expansions for the routing builder

Instance Method Summary collapse

Instance Method Details

#pattern(regexp_or_name, regexp = nil, &block) ⇒ Object

Allows us to define the simple routing pattern matching

Parameters:

  • regexp_or_name (Symbol, String, Regexp)

    name of the pattern or regexp for automatic-based named patterns

  • regexp (Regexp, nil) (defaults to: nil)

    nil if we use auto-generated name based on the regexp or the regexp if we used named patterns

  • block (Proc)


28
29
30
31
32
# File 'lib/karafka/pro/routing/features/patterns/builder.rb', line 28

def pattern(regexp_or_name, regexp = nil, &block)
  consumer_group(default_group_id) do
    pattern(regexp_or_name, regexp, &block)
  end
end