Sha256: aab020e460d932a50ea7fcf3ed80db67482f94fb3ec38963d02009c3f25cb479

Contents?: true

Size: 950 Bytes

Versions: 3

Compression:

Stored size: 950 Bytes

Contents

# frozen_string_literal: true

module Kafka
  class FetchedMessage
    # @return [String] the name of the topic that the message was written to.
    attr_reader :topic

    # @return [Integer] the partition number that the message was written to.
    attr_reader :partition

    def initialize(message:, topic:, partition:)
      @message = message
      @topic = topic
      @partition = partition
    end

    # @return [String] the value of the message.
    def value
      @message.value
    end

    # @return [String] the key of the message.
    def key
      @message.key
    end

    # @return [Integer] the offset of the message in the partition.
    def offset
      @message.offset
    end

    # @return [Time] the timestamp of the message.
    def create_time
      @message.create_time
    end

    # @return [Boolean] whether this record is a control record
    def is_control_record
      @message.is_control_record
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-kafka-0.7.0.alpha4 lib/kafka/fetched_message.rb
ruby-kafka-0.7.0.alpha3 lib/kafka/fetched_message.rb
ruby-kafka-0.7.0.alpha2 lib/kafka/fetched_message.rb