Annotation Interface KafkaHandler
@Target({METHOD,ANNOTATION_TYPE})
@Retention(RUNTIME)
@MessageMapping
@Documented
public @interface KafkaHandler
Annotation that marks a method to be the target of a Kafka message
listener within a class that is annotated with
KafkaListener
.
See the KafkaListener
for information about permitted method signatures
and available parameters.
It is important to understand that when a message arrives, the method selection
depends on the payload type. The type is matched with a single non-annotated parameter,
or one that is annotated with @Payload
.
There must be no ambiguity - the system
must be able to select exactly one method based on the payload type.
- Author:
- Gary Russell
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
When true, designate that this is the default fallback method if the payload type matches no otherKafkaHandler
method.
-
Element Details
-
isDefault
boolean isDefaultWhen true, designate that this is the default fallback method if the payload type matches no otherKafkaHandler
method. Only one method can be so designated.- Returns:
- true if this is the default method.
- Since:
- 2.1.3
- Default:
- false
-