franz/consumer_config

Types

pub type ConsumerConfig {
  BeginOffset(OffsetTime)
  MinBytes(Int)
  MaxBytes(Int)
  MaxWaitTime(Int)
  SleepTimeout(Int)
  PrefetchCount(Int)
  PrefetchBytes(Int)
  OffsetResetPolicy(OffsetResetPolicy)
  SizeStatWindow(Int)
  IsolationLevel(isolation_level.IsolationLevel)
  ShareLeaderConn(Bool)
}

Constructors

  • BeginOffset(OffsetTime)

    The offset from which to begin fetch requests. A subscriber may consume and process messages, then persist the associated offset to a persistent storage, then start (or restart) from last_processed_offset + 1 as the begin_offset to proceed. The offset has to already exist at the time of calling. Default: Latest

  • MinBytes(Int)

    Minimal bytes to fetch in a batch of messages Default: 0

  • MaxBytes(Int)

    Maximum bytes to fetch in a batch of messages. NOTE: this value might be expanded to retry when it is not enough to fetch even a single message, then slowly shrunk back to the given value. Default: 1 MB

  • MaxWaitTime(Int)

    Max number of seconds allowed for the broker to collect min_bytes of messages in fetch response. Default: 10000 ms

  • SleepTimeout(Int)

    Allow consumer process to sleep this amount of ms if kafka replied ‘empty’ message set. Default: 1000 ms

  • PrefetchCount(Int)

    The window size (number of messages) allowed to fetch-ahead. Default: 10

  • PrefetchBytes(Int)

    The total number of bytes allowed to fetch-ahead. Default: 100KB

  • OffsetResetPolicy(OffsetResetPolicy)

    How to reset BeginOffset if OffsetOutOfRange exception is received. Default: ResetBySubscriber

  • SizeStatWindow(Int)

    The moving-average window size to calculate average message size. Average message size is used to shrink max_bytes in fetch requests after it has been expanded to fetch a large message. Use 0 to immediately shrink back to original max_bytes from config. A size estimation allows users to set a relatively small max_bytes, then let it dynamically adjust to a number around PrefetchCount * AverageSize. Default: 5

  • IsolationLevel(isolation_level.IsolationLevel)

    Level to control what transaction records are exposed to the consumer. Two values are allowed, read_uncommitted to retrieve all records, independently on the transaction outcome (if any), and read_committed to get only the records from committed transactions Default: ReadCommited

  • ShareLeaderConn(Bool)

    Whether or not share the partition leader connection with other producers or consumers. Set to true to consume less TCP connections towards Kafka, but may lead to higher fetch latency. This is because Kafka can ony accumulate messages for the oldest fetch request, later requests behind it may get blocked until max_wait_time expires for the oldest one.

pub type OffsetResetPolicy {
  ResetBySubscriber
  ResetToEarliest
  ResetToLatest
}

Constructors

  • ResetBySubscriber

    Default value

  • ResetToEarliest
  • ResetToLatest
pub type OffsetTime {
  Latest
  Earliest
  MessageTimestamp(Int)
}

Constructors

  • Latest

    Default value

  • Earliest
  • MessageTimestamp(Int)
Search Document