Sha256: adefac0a6c2df06d6f583fc9ef5e2c0ee812295c286492f1a92daa8f3cb87871

Contents?: true

Size: 594 Bytes

Versions: 25

Compression:

Stored size: 594 Bytes

Contents

# frozen_string_literal: true

require "forwardable"

module Racecar
  class Message
    extend Forwardable

    attr_reader :retries_count

    def initialize(rdkafka_message, retries_count: nil)
      @rdkafka_message = rdkafka_message
      @retries_count   = retries_count
    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

25 entries across 25 versions & 1 rubygems

Version Path
racecar-2.11.0 lib/racecar/message.rb
racecar-2.11.0.beta4 lib/racecar/message.rb
racecar-2.11.0.beta3 lib/racecar/message.rb
racecar-2.11.0.beta2 lib/racecar/message.rb
racecar-2.11.0.beta1 lib/racecar/message.rb
racecar-2.10.0 lib/racecar/message.rb
racecar-2.10.0.beta2 lib/racecar/message.rb
racecar-2.10.0.beta1 lib/racecar/message.rb
racecar-2.9.0 lib/racecar/message.rb
racecar-2.9.0.beta1 lib/racecar/message.rb
racecar-2.8.2 lib/racecar/message.rb
racecar-2.8.2.beta lib/racecar/message.rb
racecar-2.8.1 lib/racecar/message.rb
racecar-2.8.0.rc.1 lib/racecar/message.rb
racecar-2.8.0.beta.2 lib/racecar/message.rb
racecar-2.8.0.beta.1 lib/racecar/message.rb
racecar-2.7.0 lib/racecar/message.rb
racecar-2.7.0.beta1 lib/racecar/message.rb
racecar-2.6.0 lib/racecar/message.rb
racecar-2.5.0 lib/racecar/message.rb