question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kafka consumer property 'resetOffsets' has no effect

See original GitHub issue

While creating a consumer (and setting group id), the property spring.cloud.stream.kafka.bindings.<channelName>.consumer.resetOffsets (as described here: http://docs.spring.io/spring-cloud-stream/docs/Brooklyn.RELEASE/reference/htmlsingle/#_kafka_consumer_properties) seems to have no effect, and consumer consumes from last offset. Sample properties:

spring:
  cloud:
    stream:
      bindings:
        input:
          destination: topic
          group: sample_group
      kafka:
        bindings:
          input:
            consumer:
              resetOffsets: true
              startOffset: earliest

The KafkaConsumerProperties#resetOffsets extension is set to true, but it doesn’t seem to trigger any specific resetting of offsets.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
mbogoevicicommented, Nov 1, 2016

Hi @cmuelhau,

We have another open issue for this: #63 . This is an feature loss that has been introduced by the adoption of the new Kafka client with rebalancing support (we should update documentation to reflect that). Implementation-wise this is a problem when auto-rebalance with multiple instances comes into play, as multiple arriving instances may reset multiple times without the proper coordination. We are currently deciding whether to officially drop this feature or support it only when auto-rebalancing is disabled (partition allocation is static based on index/instanceCount like in 1.0).

In the mean time, a solution for this would be to use a new group name when rebalance is required, which would effectively force the consumer to reset.

Really looking for the best suggestion here, as we’d really want to be able to support this, but we’re also aware that we should do so in a manner that works properly.

Thank you for the interest!

1reaction
mbogoevicicommented, Mar 24, 2017

No problem. There is another specific use case where we could in principle support this, using named groups: rebalancing can be suppressed in the clients using autoRebalanceEnable=false - see http://docs.spring.io/autorepo/docs/spring-cloud-stream-docs/Brooklyn.BUILD-SNAPSHOT/reference/htmlsingle/#_kafka_consumer_properties. In those cases the behaviour on start (or restart) is deterministic enough so that we can consider supporting resetting offsets. We’ve thought about this for a while - happy to get some feedback here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Kafka consumer property 'resetOffsets' has no effect -
Kafka consumer property 'resetOffsets' has no effect. ... While creating a consumer (and setting group id), the property spring.cloud.stream.kafka.bindings.
Read more >
Will spring-cloud-stream Kafka consumer not ... - Stack Overflow
A fixed consumer group is provided. spring.cloud.stream.bindings.input.group=sampleconsumergroup. The resetoffsets and startOffset properties ...
Read more >
Spring Cloud Stream Kafka Binder Reference Guide
Map with a key/value pair containing generic Kafka consumer properties. ... Note: Using resetOffsets on the consumer does not have any effect on...
Read more >
Kafka Consumer Groups & Offsets - Conduktor
The benefit of leveraging a Kafka consumer group is that the consumers within the group will coordinate to split the work of reading...
Read more >
Kafka 1.1 Documentation
This tutorial assumes you are starting fresh and have no existing Kafka or ZooKeeper data ... There is a similar effect for older...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found