class Kafka::Protocol::FetchRequest


MaxBytes => int32
FetchOffset => int64
Partition => int32
TopicName => string
MinBytes => int32
MaxWaitTime => int32
ReplicaId => int32
FetchRequest => ReplicaId MaxWaitTime MinBytes [TopicName [Partition FetchOffset MaxBytes]]
## API Specification
A request to fetch messages from a given partition.

def api_key

def api_key
  FETCH_API
end

def api_version

def api_version
  3
end

def encode(encoder)

def encode(encoder)
  encoder.write_int32(@replica_id)
  encoder.write_int32(@max_wait_time)
  encoder.write_int32(@min_bytes)
  encoder.write_int32(@max_bytes)
  encoder.write_array(@topics) do |topic, partitions|
    encoder.write_string(topic)
    encoder.write_array(partitions) do |partition, config|
      fetch_offset = config.fetch(:fetch_offset)
      max_bytes = config.fetch(:max_bytes)
      encoder.write_int32(partition)
      encoder.write_int64(fetch_offset)
      encoder.write_int32(max_bytes)
    end
  end
end

def initialize(max_wait_time:, min_bytes:, max_bytes:, topics:)

Parameters:
  • topics (Hash) --
  • min_bytes (Integer) --
  • max_wait_time (Integer) --
def initialize(max_wait_time:, min_bytes:, max_bytes:, topics:)
  @replica_id = REPLICA_ID
  @max_wait_time = max_wait_time
  @min_bytes = min_bytes
  @max_bytes = max_bytes
  @topics = topics
end

def response_class

def response_class
  Protocol::FetchResponse
end