Sha256: 25ca80fd3f8baacc2812ab41359494e62ff0fad0c1ec5214c1b143eba46f3387

Contents?: true

Size: 609 Bytes

Versions: 28

Compression:

Stored size: 609 Bytes

Contents

# frozen_string_literal: true

module Karafka
  # Module for all supported by default serialization and deserialization ways.
  module Serialization
    # Namespace for json serializers and deserializers.
    module Json
      # Default Karafka Json deserializer for loading JSON data.
      class Deserializer
        # @param message [Karafka::Messages::Message] Message object that we want to deserialize
        # @return [Hash] hash with deserialized JSON data
        def call(message)
          message.raw_payload.nil? ? nil : ::JSON.parse(message.raw_payload)
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
karafka-2.0.10 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.9 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.8 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.7 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.6 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.5 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.4 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.3 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.2 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.1 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.0 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.0.rc6 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.0.rc5 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.0.rc4 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.0.rc3 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.0.rc2 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.0.rc1 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.0.beta5 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.0.beta4 lib/karafka/serialization/json/deserializer.rb
karafka-2.0.0.beta3 lib/karafka/serialization/json/deserializer.rb