Sha256: 067e123fe6f29dd7f17275bde6355899ec46b86f9aecfc66adc12ab4f23c627d
Contents?: true
Size: 754 Bytes
Versions: 9
Compression:
Stored size: 754 Bytes
Contents
# frozen_string_literal: true module Karafka module Extensions # Extension for metadata builder to allow building metadata from a hash module BatchMetadataBuilder # 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::BatchMetadata .new( **hash .merge('deserializer' => topic.deserializer) .transform_keys(&:to_sym) ) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems