lib/karafka/routing/features/dead_letter_queue/topic.rb in karafka-2.4.8 vs lib/karafka/routing/features/dead_letter_queue/topic.rb in karafka-2.4.9
- old
+ new
@@ -20,26 +20,31 @@
# given message to the dead-letter topic and mark it as consumed.
# @param dispatch_method [Symbol] `:produce_async` or `:produce_sync`. Describes
# whether dispatch on dlq should be sync or async (async by default)
# @param marking_method [Symbol] `:mark_as_consumed` or `:mark_as_consumed!`. Describes
# whether marking on DLQ should be async or sync (async by default)
+ # @param mark_after_dispatch [Boolean, nil] Should we mark after dispatch. `nil` means
+ # that the default strategy approach to marking will be used. `true` or `false`
+ # overwrites the default
# @return [Config] defined config
def dead_letter_queue(
max_retries: DEFAULT_MAX_RETRIES,
topic: nil,
independent: false,
transactional: true,
dispatch_method: :produce_async,
- marking_method: :mark_as_consumed
+ marking_method: :mark_as_consumed,
+ mark_after_dispatch: nil
)
@dead_letter_queue ||= Config.new(
active: !topic.nil?,
max_retries: max_retries,
topic: topic,
independent: independent,
transactional: transactional,
dispatch_method: dispatch_method,
- marking_method: marking_method
+ marking_method: marking_method,
+ mark_after_dispatch: mark_after_dispatch
)
end
# @return [Boolean] is the dlq active or not
def dead_letter_queue?