Reputation: 34119
I would like to know, if it exists a property for consumer, when the kafka server is not available to set how many times that it should try to connect to the kafka server.
I've also tried:
.withProperty(ConsumerConfig.RECONNECT_BACKOFF_MAX_MS_CONFIG, "4000")
.withProperty(ConsumerConfig.RETRY_BACKOFF_MS_CONFIG, "500")
.withProperty(ConsumerConfig.RECONNECT_BACKOFF_MS_CONFIG, "500")
and it seems, it does not work. With the settings above, I am expecting, that the consumer would stop after 4s reconnection.
As far as I know, for producer it exists the retries property.
Upvotes: 2
Views: 1380
Reputation: 5279
There is no configuration to restrict the number of retries from the consumer side.
However, there are parameters to control the frequency of reconnection
reconnect.backoff.max.ms
reconnect.backoff.ms
retry.backoff.ms
Upvotes: 1