QuizzesKafka with Spring Boot — Concept Check
intermediate
kafka

Kafka with Spring Boot — Concept Check

Questions on Kafka with Spring Boot. spring-kafka auto-configures KafkaTemplate for production and a ConcurrentKafkaListenerContainerFactory for consumption; set bootstrap-servers in application.properties.

7 minutes 7 questions Pass at 70%
Time Limit
7 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

7 questions on Kafka with Spring Boot — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.You notice that your Kafka consumer is crashing frequently due to deserialization errors. What should you configure to handle these errors gracefully?

    • AUse ErrorHandlingDeserializer for value deserialization
    • BSwitch to automatic offset commit mode
    • CReduce the consumer's concurrency level
    • DIncrease the consumer's retry count
  2. 2.A Kafka producer is configured with 'acks=all' and 'enable.idempotence=true'. What is the main benefit of this setup?

    • AAllows batch processing of messages
    • BReduces latency by skipping ISR replicas
    • CEnsures message delivery is reliable and prevents duplicates
    • DIncreases message throughput significantly
  3. 3.Your Kafka consumer is set to 'ack-mode=MANUAL_IMMEDIATE'. What does this configuration imply?

    • AOffsets are committed only after successful processing
    • BOffsets are committed before message processing begins
    • COffsets are committed automatically after message receipt
    • DOffsets are committed periodically based on a time interval
  4. 4.A developer sets 'spring.kafka.producer.linger.ms=5'. What impact does this have on the producer's performance?

    • AReduces network latency by sending messages immediately
    • BDecreases memory usage by reducing batch size
    • CEnsures messages are sent in order, preventing out-of-order delivery
    • DIncreases batching by delaying sends, potentially improving throughput
  5. 5.Your Kafka consumer group is experiencing high lag. What configuration change might help reduce this lag?

    • AReduce the batch size of the producer
    • BSwitch to automatic offset commit mode
    • CIncrease the concurrency level to match partition count
    • DDisable idempotence in the producer
  6. 6.What is the role of 'DeadLetterPublishingRecoverer' in a Kafka consumer setup?

    • AAutomatically retries failed messages indefinitely
    • BPublishes failed messages to a dead-letter topic for later analysis
    • CIncreases consumer throughput by skipping failed messages
    • DEnsures messages are processed in order
  7. 7.Your Kafka producer is experiencing high latency. Which configuration might be contributing to this issue?

    • A'acks=all' is set, causing longer wait times for acknowledgements
    • B'linger.ms=0' is set, delaying message sends
    • C'enable.idempotence=false' is causing duplicate messages
    • D'batch-size=65536' is too small, causing frequent sends