Skip to content

Commit 0cbf569

Browse files
committed
Doc Polishing
1 parent a21fdeb commit 0cbf569

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
@@ -217,9 +217,11 @@ future.addCallback(new ListenableFutureCallback<SendResult<Integer, String>>() {
217217
`SendResult` has two properties, a `ProducerRecord` and `RecordMetadata`.
218218
See the Kafka API documentation for information about those objects.
219219

220+
The `Throwable` in `onFailure` can be cast to a `KafkaProducerException`; its `producerRecord` property contains the failed record.
221+
220222
If you wish to block the sending thread to await the result, you can invoke the future's `get()` method.
221223
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.
222-
Note, however, that flushing likely significantly reduces performance.
224+
Flushing is only needed if you have set the `linger.ms` producer property and want to immediately send a partial batch.
223225

224226
====== Examples
225227

0 commit comments

Comments
 (0)