Bird
Raised Fist0

A Kafka consumer using JSON Schema receives a message with an extra field not defined in the schema. What happens?

medium📝 Debug Q7 of Q15
Kafka - Schema Registry
A Kafka consumer using JSON Schema receives a message with an extra field not defined in the schema. What happens?
AConsumer ignores the extra field and processes the rest
BConsumer throws a validation error and rejects the message
CConsumer adds the extra field to the schema automatically
DConsumer crashes and stops processing messages
Step-by-Step Solution
Solution:
  1. Step 1: Understand JSON Schema extra field handling

    By default, extra fields are ignored if schema allows additionalProperties.
  2. Step 2: Identify typical consumer behavior

    Consumer processes known fields and ignores unknown extra fields without error.
  3. Final Answer:

    Consumer ignores the extra field and processes the rest -> Option A
  4. Quick Check:

    Extra fields ignored if schema allows [OK]
Quick Trick: Extra fields ignored if schema permits additionalProperties [OK]
Common Mistakes:
MISTAKES
  • Assuming consumer rejects message
  • Thinking schema auto-updates
  • Believing consumer crashes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes