diff --git a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/message-listener-container.adoc b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/message-listener-container.adoc index e594d70491..39da98852e 100644 --- a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/message-listener-container.adoc +++ b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/message-listener-container.adoc @@ -6,7 +6,7 @@ Two `MessageListenerContainer` implementations are provided: * `KafkaMessageListenerContainer` * `ConcurrentMessageListenerContainer` -The `KafkaMessageListenerContainer` receives all message from all topics or partitions on a single thread. +The `KafkaMessageListenerContainer` receives all messages from all topics or partitions on a single thread. The `ConcurrentMessageListenerContainer` delegates to one or more `KafkaMessageListenerContainer` instances to provide multi-threaded consumption. Starting with version 2.2.7, you can add a `RecordInterceptor` to the listener container; it will be invoked before calling the listener allowing inspection or modification of the record. 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 cf0418f5d5..16c84cba3c 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,9 +139,9 @@ The following listing shows the definition of the `ProducerListener` interface: ---- public interface ProducerListener { - void onSuccess(ProducerRecord producerRecord, RecordMetadata recordMetadata); + default void onSuccess(ProducerRecord producerRecord, RecordMetadata recordMetadata); - void onError(ProducerRecord producerRecord, RecordMetadata recordMetadata, + default void onError(ProducerRecord producerRecord, RecordMetadata recordMetadata, Exception exception); } @@ -307,6 +307,7 @@ public KafkaTemplate kafkaTemplate() { Starting with version 2.5.10, you can now update the producer properties after the factory is created. This might be useful, for example, if you have to update SSL key/trust store locations after a credentials change. The changes will not affect existing producer instances; call `reset()` to close any existing producers so that new producers will be created using the new properties. + NOTE: You cannot change a transactional producer factory to non-transactional, and vice-versa. Two new methods are now provided: @@ -447,7 +448,7 @@ catch (InterruptedException e) { ... } catch (ExecutionException e) { - if (e.getCause instanceof MyException) { + if (e.getCause() instanceof MyException) { ... } } diff --git a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/serdes.adoc b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/serdes.adoc index 9dc92cf19c..ad0724bc41 100644 --- a/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/serdes.adoc +++ b/spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/serdes.adoc @@ -364,7 +364,7 @@ producerConfigs.put(DelegatingByTopicSerializer.VALUE_SERIALIZATION_TOPIC_CONFIG "topic[0-4]:" + ByteArraySerializer.class.getName() + ", topic[5-9]:" + StringSerializer.class.getName()); ... -ConsumerConfigs.put(DelegatingByTopicDeserializer.VALUE_SERIALIZATION_TOPIC_CONFIG, +consumerConfigs.put(DelegatingByTopicDeserializer.VALUE_SERIALIZATION_TOPIC_CONFIG, "topic[0-4]:" + ByteArrayDeserializer.class.getName() + ", topic[5-9]:" + StringDeserializer.class.getName()); ---- diff --git a/spring-kafka/src/main/java/org/springframework/kafka/core/DefaultKafkaConsumerFactory.java b/spring-kafka/src/main/java/org/springframework/kafka/core/DefaultKafkaConsumerFactory.java index 2bb3486444..dd95b3ef63 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/core/DefaultKafkaConsumerFactory.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/core/DefaultKafkaConsumerFactory.java @@ -74,6 +74,7 @@ * @author Adrian Gygax * @author Yaniv Nahoum * @author Sanghyeok An + * @author Borahm Lee */ public class DefaultKafkaConsumerFactory extends KafkaResourceFactory implements ConsumerFactory, BeanNameAware, ApplicationContextAware { @@ -222,7 +223,7 @@ public void setValueDeserializerSupplier(Supplier> valueDeserial /** * Set to false (default true) to prevent programmatically provided deserializers (via - * constructor or setters) from being configured using the producer configuration, + * constructor or setters) from being configured using the consumer configuration, * e.g. if the deserializers are already fully configured. * @param configureDeserializers false to not configure. * @since 2.8.7