confluentinc / confluent-kafka-dotnet

Confluent's Apache Kafka .NET client
https://github.com/confluentinc/confluent-kafka-dotnet/wiki
Apache License 2.0
60 stars 862 forks source link

Availability of commitOffsetsOnFirstJoin property #2210

Closed fabmoll closed 5 months ago

fabmoll commented 5 months ago

Description

For a specific configuration to discard/ignore pending message when a consumer start, we would like to be able to set the commitOffsetsOnFirstJoin to false.

But as I can see this property isn't available.
Is it planned for a next version? Or maybe is there away to set this property in another way?

We're using the Kafka 2.3 library

Regards.

anchitj commented 5 months ago

I think you are talking about auto.offset.reset. You can set it to latest then the consumer will start reading from the end of the log (i.e., only new messages) if no previous offset is found for the consumer's group.

Please feel free to reopen if this doesn't helps.

fabmoll commented 5 months ago

Indeed I thought I had to set those members to be able to do it:

autoCommit: false, fromOffset: 'latest' commitOffsetsOnFirstJoin: false

Thank you @anchitj