Sha256: 3fc60335b381fec169c59b9a914e9a0cea23cadfe48714d8e4a45755c2072333
Contents?: true
Size: 571 Bytes
Versions: 19
Compression:
Stored size: 571 Bytes
Contents
# frozen_string_literal: true module Sbmt module KafkaConsumer module Serialization class JsonDeserializer < BaseDeserializer def call(message) # nil payload can be present for example for tombstone messages message.raw_payload.nil? ? nil : ::JSON.parse(message.raw_payload) rescue JSON::ParserError => e raise Sbmt::KafkaConsumer::SkipUndeserializableMessage, "cannot decode message: #{e.message}, payload: #{message.raw_payload}" if skip_decoding_error raise end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems