1

'Am trying to listen to all kafka partitions , in a Spring Boot app, and use the below code as documented in assign-all-parts, however i get the exception as below

java.lang.NumberFormatException: For input string: "*"

Is there any otherway to specify all partitions? Below is what 'am trying to use

@KafkaListener(topicPartitions 
              = @TopicPartition(topic = "${mytopic}", partitionOffsets = {
              @PartitionOffset(partition = "*", initialOffset = "0")}),groupId ="${mygroup}",
            containerFactory = "kafkaListenerContainerFactory") 

    public void consumeMessages(String message)
codevalid
  • 191
  • 1
  • 3
  • 8
  • 1
    Can we see more stack trace around that `NumberFormatException`? Also: are you sure that you use the proper `spring-kafka` version? This feature made it available since `2.6`: https://github.com/spring-projects/spring-kafka/issues/1554 – Artem Bilan Sep 30 '20 at 14:22
  • Thanks very much for reaching out. We are using lower version of spring-kafka (2.5.6), Aplogies for not checking my version, before raising this question!!. – codevalid Oct 05 '20 at 12:08
  • Glad to see that we are on the same page! Please, close your question since it is not relevant. – Artem Bilan Oct 05 '20 at 13:02

1 Answers1

0

As pointed out by Artem Bilan, we need to be using 2.6. Hence closing this.

codevalid
  • 191
  • 1
  • 3
  • 8