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
See the https://docs.spring.io/spring-kafka/api/org/springframework/kafka/core/KafkaTemplate.html[Javadoc] for more detail.
64
64
65
-
IMPORTANT: In version 3.0, the methods that previously returned `ListenableFuture` have been changed to return `CompletableFuture`.
66
-
To facilitate the migration, the 2.9 version added a method `usingCompletableFuture()` which provided the same methods with `CompletableFuture` return types; this method is no longer available.
67
-
68
65
The `sendDefault` API requires that a default topic has been provided to the template.
69
66
70
67
The API takes in a `timestamp` as a parameter and stores this timestamp in the record.
71
68
How the user-provided timestamp is stored depends on the timestamp type configured on the Kafka topic.
72
69
If the topic is configured to use `CREATE_TIME`, the user-specified timestamp is recorded (or generated if not specified).
73
-
If the topic is configured to use `LOG_APPEND_TIME`, the user-specified timestamp is ignored and the broker adds in the local broker time.
70
+
If the topic is configured to use `LOG_APPEND_TIME`, the user-specified timestamp ignored and the broker adds in the local broker time.
74
71
75
72
The `metrics` and `partitionsFor` methods delegate to the same methods on the underlying https://kafka.apache.org/20/javadoc/org/apache/kafka/clients/producer/Producer.html[`Producer`].
76
73
The `execute` method provides direct access to the underlying https://kafka.apache.org/20/javadoc/org/apache/kafka/clients/producer/Producer.html[`Producer`].
@@ -342,8 +339,6 @@ The result is a `CompletableFuture` that is asynchronously populated with the re
342
339
The result also has a `sendFuture` property, which is the result of calling `KafkaTemplate.send()`.
343
340
You can use this future to determine the result of the send operation.
344
341
345
-
IMPORTANT: In version 3.0, the futures returned by these methods (and their `sendFuture` properties) have been changed to `CompletableFuture`+++s+++ instead of `ListenableFuture`+++s+++.
346
-
347
342
If the first method is used, or the `replyTimeout` argument is `null`, the template's `defaultReplyTimeout` property is used (5 seconds by default).
348
343
349
344
Starting with version 2.8.8, the template has a new method `waitForAssignment`.
These will use the template's default `replyTimeout`, there are also overloaded versions that can take a timeout in the method call.
575
570
576
-
IMPORTANT: In version 3.0, the futures returned by these methods (and their `sendFuture` properties) have been changed to `CompletableFuture`+++s+++ instead of `ListenableFuture`+++s+++.
577
-
578
571
Use the first method if the consumer's `Deserializer` or the template's `MessageConverter` can convert the payload without any additional information, either via configuration or type metadata in the reply message.
579
572
580
573
Use the second method if you need to provide type information for the return type, to assist the message converter.
0 commit comments