Module: Karafka::Pro::Routing::Features::Pausing::Topic

Defined in:
lib/karafka/pro/routing/features/pausing/topic.rb

Overview

Expansion allowing for a per topic pause strategy definitions

Instance Method Summary collapse

Instance Method Details

#pause(timeout: nil, max_timeout: nil, with_exponential_backoff: nil) ⇒ Object

Note:

We do not construct here the nested config like we do with other routing features, because this feature operates on the OSS layer by injection of values and a nested config is not needed.

Allows for per-topic pausing strategy setting

Parameters:

  • timeout (Integer) (defaults to: nil)

    how long should we wait upon processing error (milliseconds)

  • max_timeout (Integer) (defaults to: nil)

    what is the max timeout in case of an exponential backoff (milliseconds)

  • with_exponential_backoff (Boolean) (defaults to: nil)

    should we use exponential backoff



31
32
33
34
35
36
37
38
# File 'lib/karafka/pro/routing/features/pausing/topic.rb', line 31

def pause(timeout: nil, max_timeout: nil, with_exponential_backoff: nil)
  self.pause_timeout = timeout if timeout
  self.pause_max_timeout = max_timeout if max_timeout

  return unless with_exponential_backoff

  self.pause_with_exponential_backoff = with_exponential_backoff
end