Reputation: 465
How can I set the spring-boot property : spring.kafka.producer.retries to Integer.MAX_VALUE ?
Is it working to unset this property or this will default to 0 ?
@See default kafka in KIP https://cwiki.apache.org/confluence/display/KAFKA/KIP-98+-+Exactly+Once+Delivery+and+Transactional+Messaging
Upvotes: 4
Views: 9904
Reputation: 40088
By default it is 2147483647
which is Integer.MAX_VALUE
you can set between [0,...,2147483647]
retries docs
Setting a value greater than zero will cause the client to resend any record whose send fails with a potentially transient error. Note that this retry is no different than if the client resent the record upon receiving the error. Allowing retries without setting
max.in.flight.requests.per.connection
to 1 will potentially change the ordering of records because if two batches are sent to a single partition, and the first fails and is retried but the second succeeds, then the records in the second batch may appear first. Note additionally that produce requests will be failed before the number of retries has been exhausted if the timeout configured bydelivery.timeout.ms
expires first before successful acknowledgement. Users should generally prefer to leave this config unset and instead use 1delivery.timeout.ms1 to control retry behavior.
Upvotes: 2
Reputation: 49
Default value of ProducerConfig.RETRIES_CONFIG
is 2147483647
. Hope not defining the retries property will take care default value
Upvotes: 2
Reputation: 174799
According to the Kafka docs it defaults to Integer.MAX_VALUE
(at least with the current version), which concurs with the KIP.
Upvotes: 5