You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-kafka-docs/src/main/asciidoc/kafka.adoc
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1252,16 +1252,19 @@ NOTE: If you want to commit a partial batch, using `nack()`, When using transact
1252
1252
1253
1253
IMPORTANT: `nack()` can only be called on the consumer thread that invokes your listener.
1254
1254
1255
-
With a record listener, when `nack()` is called, any pending offsets are committed, the remaing records from the last poll are discarded, and seeks are performed on their partitions so that the failed record and unprocessed records are redelivered on the next `poll()`.
1256
-
The consumer thread can be paused before redelivery, by setting the `sleep` argument.
1255
+
With a record listener, when `nack()` is called, any pending offsets are committed, the remaining records from the last poll are discarded, and seeks are performed on their partitions so that the failed record and unprocessed records are redelivered on the next `poll()`.
1256
+
The consumer can be paused before redelivery, by setting the `sleep` argument.
1257
1257
This is similar functionality to throwing an exception when the container is configured with a `DefaultErrorHandler`.
1258
1258
1259
1259
When using a batch listener, you can specify the index within the batch where the failure occurred.
1260
1260
When `nack()` is called, offsets will be committed for records before the index and seeks are performed on the partitions for the failed and discarded records so that they will be redelivered on the next `poll()`.
1261
1261
1262
1262
See <<error-handlers>> for more information.
1263
1263
1264
-
IMPORTANT: When using partition assignment via group management, it is important to ensure the `sleep` argument (plus the time spent processing records from the previous poll) is less than the consumer `max.poll.interval.ms` property.
1264
+
IMPORTANT: The consumer is paused during the sleep so that we continue to poll the broker to keep the consumer alive.
1265
+
The actual sleep time, and its resolution depends on the container's `maxPollInterval` which defaults to 5 seconds.
1266
+
The minimum sleep time is equal to the `maxPollInterval` and all sleep times will be a multiple of it.
1267
+
For small sleep times, consider reducing the container's `maxPollInterval`.
0 commit comments