Sha256: 99a6f6235a31b44889114b7efab18cd9731674bbe193c363d3e9058a1d493e37
Contents?: true
Size: 693 Bytes
Versions: 3
Compression:
Stored size: 693 Bytes
Contents
# frozen_string_literal: true module Karafka module Extensions # Extension for metadata builder to allow building metadata from a hash module MetadataBuilder # Builds metadata from hash # @param hash [Hash] hash with metadata # @param topic [Karafka::Routing::Topic] topic instance # @return [Karafka::Params::Metadata] metadata instance def from_hash(hash, topic) # Parser needs to be merged as this is the only non-serializable object # so it gets reconstructed from the topic Karafka::Params::Metadata .new .merge!(hash) .merge!('deserializer' => topic.deserializer) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems