Skip to content

Commit

Permalink
Doc Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
garyrussell committed May 2, 2020
1 parent 2aef947 commit 4a57a8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/reference/asciidoc/kafka.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,11 @@ future.addCallback(new ListenableFutureCallback<SendResult<Integer, String>>() {
`SendResult` has two properties, a `ProducerRecord` and `RecordMetadata`.
See the Kafka API documentation for information about those objects.

The `Throwable` in `onFailure` can be cast to a `KafkaProducerException`; its `producerRecord` property contains the failed record.

If you wish to block the sending thread to await the result, you can invoke the future's `get()` method.
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.
Note, however, that flushing likely significantly reduces performance.
Flushing is only needed if you have set the `linger.ms` producer property and want to immediately send a partial batch.

====== Examples

Expand Down

0 comments on commit 4a57a8d

Please sign in to comment.