UnguruBulan
UnguruBulan

Reputation: 1030

Spring Kafka, overriding max.poll.interval.ms?

I need to increase max.poll.interval.ms default value of 300000 to a greater value, due to. timeout exceptions.

However I am unable to find the property (autocomplete) in application.properties to override it. Am I missing something out? Or I'm just using an old version of Spring Kafka (2.1.10)

max.poll.interval.ms = 300000
max.poll.records     = 500

Upvotes: 4

Views: 27768

Answers (3)

UnguruBulan
UnguruBulan

Reputation: 1030

spring.kafka.consumer.properties.max.poll.interval.ms=20000000

It worked

Upvotes: 11

Rahul Gupta
Rahul Gupta

Reputation: 520

You can use consumer API to set the timeout. And configure that timeout in your property file. Consumer API provide following way to set poll duration.

    @Value("${pollDuration}")
    private Long pollDuration;   //read from property file

    ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(pollDuration));

Consumer provides the different type of arguments for poll method. You can use according to your requirement.

Upvotes: -1

PatrickChen
PatrickChen

Reputation: 1420

There is an API, you have to set it manually. Read from the properties file and set it.

Upvotes: 0

Related Questions