Sha256: cb11c59597cf92c960b0c7071725594596d92e95b86c31d1ac4db682b959a54a

Contents?: true

Size: 472 Bytes

Versions: 7

Compression:

Stored size: 472 Bytes

Contents

require "forwardable"

module Racecar
  class Message
    extend Forwardable

    def initialize(rdkafka_message)
      @rdkafka_message = rdkafka_message
    end

    def_delegators :@rdkafka_message, :topic, :partition, :offset, :key, :headers

    def value
      @rdkafka_message.payload
    end

    def create_time
      @rdkafka_message.timestamp
    end

    def ==(other)
      @rdkafka_message == other.instance_variable_get(:@rdkafka_message)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
racecar-2.0.0 lib/racecar/message.rb
racecar-2.0.0.beta6 lib/racecar/message.rb
racecar-2.0.0.beta5 lib/racecar/message.rb
racecar-2.0.0.beta4 lib/racecar/message.rb
racecar-2.0.0.beta3 lib/racecar/message.rb
racecar-2.0.0.beta2 lib/racecar/message.rb
racecar-2.0.0.beta1 lib/racecar/message.rb