Skip to content

Commit

Permalink
Refine docs for consistency and correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
bky373 authored Oct 23, 2024
1 parent ee56e66 commit 5c7ec23
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ The following listing shows the definition of the `ProducerListener` interface:
----
public interface ProducerListener<K, V> {
void onSuccess(ProducerRecord<K, V> producerRecord, RecordMetadata recordMetadata);
default void onSuccess(ProducerRecord<K, V> producerRecord, RecordMetadata recordMetadata);
void onError(ProducerRecord<K, V> producerRecord, RecordMetadata recordMetadata,
default void onError(ProducerRecord<K, V> producerRecord, RecordMetadata recordMetadata,
Exception exception);
}
Expand Down Expand Up @@ -307,6 +307,7 @@ public KafkaTemplate<Integer, CustomValue> 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:
Expand Down Expand Up @@ -447,7 +448,7 @@ catch (InterruptedException e) {
...
}
catch (ExecutionException e) {
if (e.getCause instanceof MyException) {
if (e.getCause() instanceof MyException) {
...
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
* @author Adrian Gygax
* @author Yaniv Nahoum
* @author Sanghyeok An
* @author Borahm Lee
*/
public class DefaultKafkaConsumerFactory<K, V> extends KafkaResourceFactory
implements ConsumerFactory<K, V>, BeanNameAware, ApplicationContextAware {
Expand Down Expand Up @@ -222,7 +223,7 @@ public void setValueDeserializerSupplier(Supplier<Deserializer<V>> 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
Expand Down

0 comments on commit 5c7ec23

Please sign in to comment.