Sha256: 912f9e2b83feb904d0f91236f3aba4b0c0d09821402f7bc617461730a1af4838

Contents?: true

Size: 1.25 KB

Versions: 7

Compression:

Stored size: 1.25 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 ScheduledMessages
      module Deserializers
        # States payload deserializer
        # We only deserialize states data and never anything else. Other payloads are the payloads
        # we are expected to proxy, thus there is no need to deserialize them in any context.
        # Their appropriate target topics should have expected deserializers
        class Payload
          # @param message [::Karafka::Messages::Message]
          # @return [Hash] deserialized data
          def call(message)
            ::JSON.parse(
              Zlib::Inflate.inflate(message.raw_payload),
              symbolize_names: true
            )
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
karafka-2.4.16 lib/karafka/pro/scheduled_messages/deserializers/payload.rb
karafka-2.4.15 lib/karafka/pro/scheduled_messages/deserializers/payload.rb
karafka-2.4.14 lib/karafka/pro/scheduled_messages/deserializers/payload.rb
karafka-2.4.13 lib/karafka/pro/scheduled_messages/deserializers/payload.rb
karafka-2.4.12 lib/karafka/pro/scheduled_messages/deserializers/payload.rb
karafka-2.4.11 lib/karafka/pro/scheduled_messages/deserializers/payload.rb
karafka-2.4.10 lib/karafka/pro/scheduled_messages/deserializers/payload.rb