Skip to content

Commit eec711c

Browse files
GH-3807: Doc about @KafkaHandler requirements
Fixes: #3807 Signed-off-by: chickenchickenlove <[email protected]>
1 parent 1abad40 commit eec711c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/class-level-kafkalistener.adoc

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
= `@KafkaListener` on a Class
33

44
When you use `@KafkaListener` at the class-level, you must specify `@KafkaHandler` at the method level.
5+
If no `@KafkaHandler` on any methods of this class or its sub-classes, the framework will reject such a configuration.
6+
The `@KafkaHandler` annotation is required for explicit and concise purpose of the method.
7+
Otherwise it is hard to make a decision about this or other method without extra restrictions.
8+
59
When messages are delivered, the converted message payload type is used to determine which method to call.
610
The following example shows how to do so:
711

@@ -58,4 +62,3 @@ void listen(Object in, @Header(KafkaHeaders.RECORD_METADATA) ConsumerRecordMetad
5862
...
5963
}
6064
----
61-

0 commit comments

Comments
 (0)