Sha256: 01315f966a72d7a0daf6576ea4b1a005130543bf492b7ae21e6b7399b65db3bd
Contents?: true
Size: 622 Bytes
Versions: 9
Compression:
Stored size: 622 Bytes
Contents
require 'kafka_session/delivered_message' class KafkaSession class MockProducer def initialize @messages_by_topic = Hash.new { |messages, topic| messages[topic] = [] } end def publish(topic:, messages:) messages.each do |message| @messages_by_topic[topic] << OpenStruct.new( value: message, topic: topic, partition: 1, offset: 100, key: nil ) end end def messages_for_topic(topic) @messages_by_topic[topic].map do |message| DeliveredMessage.new(message) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems