Skip to content

Commit 4a57a8d

Browse files
committed
Doc Polishing
1 parent 2aef947 commit 4a57a8d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/reference/asciidoc/kafka.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,11 @@ future.addCallback(new ListenableFutureCallback<SendResult<Integer, String>>() {
315315
`SendResult` has two properties, a `ProducerRecord` and `RecordMetadata`.
316316
See the Kafka API documentation for information about those objects.
317317

318+
The `Throwable` in `onFailure` can be cast to a `KafkaProducerException`; its `producerRecord` property contains the failed record.
319+
318320
If you wish to block the sending thread to await the result, you can invoke the future's `get()` method.
319321
You may wish to invoke `flush()` before waiting or, for convenience, the template has a constructor with an `autoFlush` parameter that causes the template to `flush()` on each send.
320-
Note, however, that flushing likely significantly reduces performance.
322+
Flushing is only needed if you have set the `linger.ms` producer property and want to immediately send a partial batch.
321323

322324
====== Examples
323325

0 commit comments

Comments
 (0)