Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 you do not use `@KafkaHandler`, no method will be used as a listener.

IMPORTANT: This is because a class annotated at the class-level may be extended or inherited in various ways.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I'm not disagree with the info, it feels a bit awkward.
Even the first new sentence is confusing.

How about to have a text like this after that "you must specify @KafkaHandler ":

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! thanks for fixing it. 🙇‍♂️
I updated.


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:

Expand Down Expand Up @@ -58,4 +62,3 @@ void listen(Object in, @Header(KafkaHeaders.RECORD_METADATA) ConsumerRecordMetad
...
}
----