Bird
0
0

What happens if you send a message to a Kafka topic that has no active listeners in a Spring Boot application?

medium📝 Conceptual Q5 of 15
Spring Boot - Messaging
What happens if you send a message to a Kafka topic that has no active listeners in a Spring Boot application?
AMessage is stored in Kafka and delivered when a listener subscribes
BMessage is lost immediately
CApplication throws an exception
DMessage is stored in application memory
Step-by-Step Solution
Solution:
  1. Step 1: Understand Kafka message storage

    Kafka stores messages in topics regardless of active consumers.
  2. Step 2: Delivery on subscription

    When a listener subscribes later, it can consume stored messages.
  3. Final Answer:

    Message is stored in Kafka and delivered when a listener subscribes -> Option A
  4. Quick Check:

    Kafka stores messages until consumed [OK]
Quick Trick: Kafka retains messages until consumed by listeners [OK]
Common Mistakes:
  • Thinking messages are lost without listeners
  • Expecting exceptions on send without listeners
  • Assuming messages are stored in app memory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes