Module: Karafka::Pro::Routing::Features::DeadLetterQueue::Topic
- Defined in:
- lib/karafka/pro/routing/features/dead_letter_queue/topic.rb
Overview
Expansions to the topic API in DLQ
Instance Method Summary collapse
-
#dead_letter_queue(strategy: nil, **args) ⇒ Object
(same as in OSS) should be applied.
Instance Method Details
#dead_letter_queue(strategy: nil, **args) ⇒ Object
(same as in OSS) should be applied
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/karafka/pro/routing/features/dead_letter_queue/topic.rb', line 16 def dead_letter_queue(strategy: nil, **args) return @dead_letter_queue if @dead_letter_queue super(**args).tap do |config| # If explicit strategy is not provided, use the default approach from OSS config.strategy = strategy || lambda do |_errors_tracker, attempt| attempt > config.max_retries ? :dispatch : :retry end end end |