GH-3807: Doc about @KafkaHandler requirements
Fixes: #3807 Signed-off-by: chickenchickenlove <ojt90902@naver.com>
This commit is contained in:
committed by
GitHub
parent
1abad4010c
commit
eec711cc84
@@ -2,6 +2,10 @@
|
||||
= `@KafkaListener` on a Class
|
||||
|
||||
When you use `@KafkaListener` at the class-level, you must specify `@KafkaHandler` at the method level.
|
||||
If no `@KafkaHandler` on any methods of this class or its sub-classes, the framework will reject such a configuration.
|
||||
The `@KafkaHandler` annotation is required for explicit and concise purpose of the method.
|
||||
Otherwise it is hard to make a decision about this or other method without extra restrictions.
|
||||
|
||||
When messages are delivered, the converted message payload type is used to determine which method to call.
|
||||
The following example shows how to do so:
|
||||
|
||||
@@ -58,4 +62,3 @@ void listen(Object in, @Header(KafkaHeaders.RECORD_METADATA) ConsumerRecordMetad
|
||||
...
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
Reference in New Issue
Block a user