Module: Karafka::Pro::Cleaner::Messages::Messages
- Defined in:
- lib/karafka/pro/cleaner/messages/messages.rb
Overview
Extensions to the messages batch allowing for automatic cleaning of each message after message is processed.
Instance Method Summary collapse
Instance Method Details
#each(clean: false) { ... } ⇒ Object
Note:
Cleaning messages after we’re done with each of them and did not fail does not affect any other functionalities. The only thing that is crucial is to make sure, that if DLQ is used, that we mark each message as consumed when using this API as otherwise a cleaned message may be dispatched and that should never happen
29 30 31 32 33 34 35 36 37 |
# File 'lib/karafka/pro/cleaner/messages/messages.rb', line 29 def each(clean: false) @messages_array.each do || yield() next unless clean .clean! end end |