Initial offset of consumer group with none auto.offset.reset.policy

227 views Asked by At

I have auto.offset.reset=none in my consumer because I need to know about OutOfRangeException event.

I have MessageListenereContainer with custom ErrorHandler where I catch OutOfRange exception and manually do seekToEnd for my consumer.

That's great and absolutelly what I need.

But if it's new consumer group that's problem. Kafka considers it's fatal error and stop my consumer with NoOffsetForPartitionException because for new consumer group offset is undefined (1239 row of KafkaMessageListenerContainer.java). What is the right way do not use auto.offset.reset but be able manually set initial offset for new consumer group?

I use MessageListenerContainer for consuming.

0

There are 0 answers