Skip to content

ConsumerConfig

auto.commit.interval.ms

auto.offset.reset

What to do when there is no initial offset in Kafka or if the current offset does not exist anymore on a broker (e.g. because that data has been deleted)

Default: latest

Supported values:

  • latest - reset the offset to the latest offset
  • earliest - reset the offset to the earliest offset
  • none - throw exception to the consumer if no previous offset is found for the consumer's group

check.crcs

client.rack

enable.auto.commit

Controls whether consumer offsets should be periodically committed in the background or not

Default: true

kafka-console-consumer supports the property using --consumer-property or --consumer.config options.

Used when:

fetch.max.bytes

fetch.max.wait.ms

fetch.min.bytes

group.id

See CommonClientConfigs

internal.throw.on.fetch.stable.offset.unsupported

isolation.level

Controls how KafkaConsumer should read messages written transactionally

Default: read_uncommitted

Supported values:

  • read_uncommitted - Consumer.poll() will only return transactional messages which have been committed (filtering out transactional messages which are not committed).

  • read_committed - Consumer.poll() will return all messages, even transactional messages which have been not committed yet or even aborted.

Non-transactional messages will be returned unconditionally in either mode.

Messages will always be returned in offset order. Hence, in read_committed mode, consumer.poll() will only return messages up to the last stable offset (LSO), which is the one less than the offset of the first open transaction.

In particular any messages appearing after messages belonging to ongoing transactions will be withheld until the relevant transaction has been completed.

As a result, read_committed consumers will not be able to read up to the high watermark when there are in-flight transactions.

Further, when in read_committed the seekToEnd method will return the last stable offset.

kafka-console-consumer supports the property using --isolation-level option.

max.partition.fetch.bytes

max.poll.records

request.timeout.ms

retry.backoff.ms


maybeOverrideEnableAutoCommit

boolean maybeOverrideEnableAutoCommit()

maybeOverrideEnableAutoCommit returns false when neither group.id nor enable.auto.commit are specified. Otherwise, maybeOverrideEnableAutoCommit returns the value of enable.auto.commit configuration property.

maybeOverrideEnableAutoCommit throws an InvalidConfigurationException when no group.id is given with enable.auto.commit enabled:

enable.auto.commit cannot be set to true when default group id (null) is used.

maybeOverrideEnableAutoCommit is used when:

Back to top