diff --git a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/appendix/change-history.adoc b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/appendix/change-history.adoc index 5388c207df..7842d96056 100644 --- a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/appendix/change-history.adoc +++ b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/appendix/change-history.adoc @@ -386,7 +386,7 @@ The `@KafkaListener` annotation now has the `filter` attribute, to override the The `@KafkaListener` annotation now has the `info` attribute; this is used to populate the new listener container property `listenerInfo`. This is then used to populate a `KafkaHeaders.LISTENER_INFO` header in each record which can be used in `RecordInterceptor`, `RecordFilterStrategy`, or the listener itself. -See xref:kafka/annotation-error-handling.adoc#li-header[Listener Info Header] and xref:kafka/container-props.adoc#alc-props[Abstract Listener Container Properties] for more information. +See xref:kafka/annotation-error-handling.adoc#li-header[Listener Info Header] and xref:kafka/container-props.adoc#amlc-props[AbstractMessageListenerContainer Properties] for more information. [[x28-template]] === `KafkaTemplate` Changes diff --git a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/container-props.adoc b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/container-props.adoc index bb5fe5a577..7daab75789 100644 --- a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/container-props.adoc +++ b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/container-props.adoc @@ -130,7 +130,7 @@ Also see `idleBeforeDataMultiplier`. |[[listenerTaskExecutor]]<> |`SimpleAsyncTaskExecutor` |A task executor to run the consumer threads. -The default executor creates threads named `-C-n`; with the `KafkaMessageListenerContainer`, the name is the bean name; with the `ConcurrentMessageListenerContainer` the name is the bean name suffixed with `-n` where n is incremented for each child container. +The default executor creates threads named `-C-n`; with the `KafkaMessageListenerContainer`, the name is the bean name; with the `ConcurrentMessageListenerContainer` the name is the bean name suffixed with `-m` where `m` is incremented for each child container. See xref:kafka/receiving-messages/container-thread-naming.adoc#container-thread-naming[Container Thread Naming]. |[[logContainerConfig]]<> |`false` @@ -239,8 +239,8 @@ Mutually exclusive; at least one must be provided; enforced by `ContainerPropert |Deprecated since 3.2, see <>, xref:kafka/transactions.adoc#transaction-synchronization[Other transaction managers]. |=== -[[alc-props]] -.`AbstractListenerContainer` Properties +[[amlc-props]] +.`AbstractMessageListenerContainer` Properties [cols="9,10,16", options="header"] |=== | Property @@ -320,10 +320,6 @@ Also see `interceptBeforeTx`. |(read only) |The partitions currently assigned to this container (explicitly or not). -|[[assignedPartitionsByClientId]]<> -|(read only) -|The partitions currently assigned to this container (explicitly or not). - |[[clientIdSuffix]]<> |`null` |Used by the concurrent container to give each child container's consumer a unique `client.id`. @@ -348,10 +344,6 @@ Also see `interceptBeforeTx`. |(read only) |The aggregate of partitions currently assigned to this container's child `KafkaMessageListenerContainer`+++s+++ (explicitly or not). -|[[assignedPartitionsByClientId2]]<> -|(read only) -|The partitions currently assigned to this container's child `KafkaMessageListenerContainer`+++s+++ (explicitly or not), keyed by the child container's consumer's `client.id` property. - |[[concurrency]]<> |1 |The number of child `KafkaMessageListenerContainer`+++s+++ to manage. diff --git a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/events.adoc b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/events.adoc index 47856b0dcb..a6249286bd 100644 --- a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/events.adoc +++ b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/events.adoc @@ -111,7 +111,7 @@ You can use this event to restart the container after such a condition: [source, java] ---- -if (event.getReason.equals(Reason.FENCED)) { +if (event.getReason().equals(Reason.FENCED)) { event.getSource(MessageListenerContainer.class).start(); } ---- @@ -205,7 +205,7 @@ Consequently, in the preceding example, we narrow the events received based on t Since containers created for the `@KafkaListener` support concurrency, the actual containers are named `id-n` where the `n` is a unique value for each instance to support the concurrency. That is why we use `startsWith` in the condition. -CAUTION: If you wish to use the idle event to stop the lister container, you should not call `container.stop()` on the thread that calls the listener. +CAUTION: If you wish to use the idle event to stop the listener container, you should not call `container.stop()` on the thread that calls the listener. Doing so causes delays and unnecessary log messages. Instead, you should hand off the event to a different thread that can then stop the container. Also, you should not `stop()` the container instance if it is a child container. diff --git a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/annotation-send-to.adoc b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/annotation-send-to.adoc index b5102fd02e..6a5b3d23d2 100644 --- a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/annotation-send-to.adoc +++ b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/annotation-send-to.adoc @@ -117,7 +117,7 @@ The following example shows how to do so: ---- @Bean public KafkaTemplate myReplyingTemplate() { - return new KafkaTemplate(producerFactory()) { + return new KafkaTemplate(producerFactory()) { @Override public CompletableFuture> send(String topic, String data) { diff --git a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/sending-messages.adoc b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/sending-messages.adoc index 16c84cba3c..4ac422900a 100644 --- a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/sending-messages.adoc +++ b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/sending-messages.adoc @@ -139,10 +139,11 @@ The following listing shows the definition of the `ProducerListener` interface: ---- public interface ProducerListener { - default void onSuccess(ProducerRecord producerRecord, RecordMetadata recordMetadata); + default void onSuccess(ProducerRecord producerRecord, RecordMetadata recordMetadata) { + } - default void onError(ProducerRecord producerRecord, RecordMetadata recordMetadata, - Exception exception); + default void onError(ProducerRecord producerRecord, RecordMetadata recordMetadata, Exception exception) { + } } ----