Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

@Kafkalistener

Pragya Keshap answered on February 11, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • @KafkaListener on a Class

  • @Kafkalistener

    0

    Annotation that marks a method to be the target of a Kafka message listener on the specified topics. The containerFactory() identifies the KafkaListenerContainerFactory to use to build the Kafka listener container. If not set, a default container factory is assumed to be available with a bean name of kafkaListenerContainerFactory unless an explicit default has been provided through configuration.

    Processing of @KafkaListener annotations is performed by registering a KafkaListenerAnnotationBeanPostProcessor. This can be done manually or, more conveniently, through EnableKafka annotation.

    Annotated methods are allowed to have flexible signatures similar to what MessageMapping provides, that is

    ConsumerRecord to access to the raw Kafka message

    Acknowledgment to manually ack

    @Payload-annotated method arguments including the support of validation

    @Header-annotated method arguments to extract a specific header value, defined by KafkaHeaders

    @Headers-annotated argument that must also be assignable to Map for getting access to all headers.

    MessageHeaders arguments for getting access to all headers.

    MessageHeaderAccessor for convenient access to all method arguments.

    When defined at the method level, a listener container is created for each method. The MessageListener is a MessagingMessageListenerAdapter, configured with a MethodKafkaListenerEndpoint.

    When defined at the class level, a single message listener container is used to service all methods annotated with @KafkaHandler. Method signatures of such annotated methods must not cause any ambiguity such that a single method can be resolved for a particular inbound message. The MessagingMessageListenerAdapter is configured with a MultiMethodKafkaListenerEndpoint.

    https://www.baeldung.com/spring-kafka

    Popularity 1/10 Helpfulness 1/10 Language java
    Source: Grepper
    Tags: java
    Link to this answer
    Share Copy Link
    Contributed on Feb 11 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.