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
Copy file name to clipboardExpand all lines: spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/class-level-kafkalistener.adoc
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,7 @@
1
1
[[class-level-kafkalistener]]
2
2
= `@KafkaListener` on a Class
3
3
4
-
When you use `@KafkaListener` at the class-level, if there is only one public method, you do not need to specify `@KafkaHandler`.
5
-
However, if there are multiple public methods, you must specify `@KafkaHandler` at the method level.
4
+
When you use `@KafkaListener` at the class-level, you must specify `@KafkaHandler` at the method level.
6
5
When messages are delivered, the converted message payload type is used to determine which method to call.
7
6
The following example shows how to do so:
8
7
@@ -59,3 +58,4 @@ void listen(Object in, @Header(KafkaHeaders.RECORD_METADATA) ConsumerRecordMetad
Copy file name to clipboardExpand all lines: spring-kafka-docs/src/main/antora/modules/ROOT/pages/whats-new.adoc
-7Lines changed: 0 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -70,10 +70,3 @@ Several deprecated items have been removed:
70
70
71
71
Spring for Apache Kafka 4.0 supports Kafka 4.0’s new consumer rebalance protocol - https://cwiki.apache.org/confluence/display/KAFKA/KIP-848%3A+The+Next+Generation+of+the+Consumer+Rebalance+Protocol[KIP-848].
72
72
For details, see xref:kafka/receiving-messages/rebalance-listeners.adoc#new-rebalalcne-protocol[New Consumer Rebalace Protocol docs].
73
-
74
-
[[x40-single-public-method-listener]]
75
-
=== Single Public Method Listener Simplification
76
-
77
-
Spring for Apache Kafka 4.0 simplifies the use of class-level `@KafkaListener` annotations.
78
-
Previously, when `@KafkaListener` was declared at the class level, each public method intended to handle messages had to be annotated explicitly with `@KafkaHandler`.
79
-
Now, if there is exactly one public method in the class, it will be automatically recognized as the listener method even without the `@KafkaHandler` annotation. For details, see xref:kafka/receiving-messages/class-level-kafkalistener.adoc#class-level-kafkalistener[Class Level Kafka Listener].
Copy file name to clipboardExpand all lines: spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java
+2-15Lines changed: 2 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,6 @@
20
20
importjava.io.StringReader;
21
21
importjava.lang.reflect.AnnotatedElement;
22
22
importjava.lang.reflect.Method;
23
-
importjava.lang.reflect.Modifier;
24
23
importjava.nio.ByteBuffer;
25
24
importjava.nio.charset.Charset;
26
25
importjava.nio.charset.StandardCharsets;
@@ -412,20 +411,8 @@ public Object postProcessAfterInitialization(final Object bean, final String bea
0 commit comments