Sha256: 51c82b9ebcf8028ee016314feed87a7c349e53e18ae6ee4148b49e4b58f75e9e

Contents?: true

Size: 1.66 KB

Versions: 21

Compression:

Stored size: 1.66 KB

Contents

# frozen_string_literal: true

# This Karafka component is a Pro component under a commercial license.
# This Karafka component is NOT licensed under LGPL.
#
# All of the commercial components are present in the lib/karafka/pro directory of this
# repository and their usage requires commercial license agreement.
#
# Karafka has also commercial-friendly license, commercial support and commercial components.
#
# By sending a pull request to the pro components, you are agreeing to transfer the copyright of
# your code to Maciej Mensfeld.

module Karafka
  module Pro
    module Processing
      module Strategies
        module Dlq
          # - DLQ
          # - Ftr
          module Ftr
            include Strategies::Ftr::Default
            include Strategies::Dlq::Default

            # Features for this strategy
            FEATURES = %i[
              dead_letter_queue
              filtering
            ].freeze

            # DLQ flow is standard here, what is not, is the success component where we need to
            # take into consideration the filtering
            def handle_after_consume
              coordinator.on_finished do |last_group_message|
                return if revoked?

                if coordinator.success?
                  coordinator.pause_tracker.reset

                  return if coordinator.manual_pause?

                  mark_as_consumed(last_group_message)

                  handle_post_filtering
                else
                  apply_dlq_flow do
                    dispatch_if_needed_and_mark_as_consumed
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
karafka-2.4.16 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.15 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.14 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.13 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.12 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.11 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.10 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.9 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.8 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.7 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.6 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.5 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.4 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.3 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.0 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.0.rc1 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.3.4 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.0.beta2 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.4.0.beta1 lib/karafka/pro/processing/strategies/dlq/ftr.rb
karafka-2.3.3 lib/karafka/pro/processing/strategies/dlq/ftr.rb