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

Publishing Messages

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

Contents


More Related Answers

  • send messages
  • Get Messages
  • Get Messages
  • Get Messages
  • How messaging works?
  • Producing Messages
  • Consuming Messages
  • Consuming Custom Messages
  • import messages

  • Publishing Messages

    0

    We can send messages using the KafkaTemplate class:

    The send API returns a ListenableFuture object. If we want to block the sending thread and get the result about the sent message, we can call the get API of the ListenableFuture object. The thread will wait for the result, but it will slow down the producer.

    Kafka is a fast-stream processing platform. Therefore, it's better to handle the results asynchronously so that the subsequent messages do not wait for the result of the previous message.

    We can do this through a callback:

    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.