---
title: "Kafka consumer cannot read a new schema under BACKWARD"
description: "Schema Registry accepts a BACKWARD change, then a Kafka consumer still on the old schema stops on RecordDeserializationException. Upgrade consumers first."
url: https://monedula.dev/kafka-simulator/scenarios/consumer-reader-incompatible/
---

# Kafka consumer cannot read a new schema under BACKWARD

Scenario 25.1.11 · Backward mode accepts it, an old consumer cannot read it. Schema registry · Intermediate · about 3 min · Apache Kafka 4.4 · Confluent Platform feature.

Under backward mode a producer removes a field without a default: the registry accepts v2, and a consumer still on v1 stops on a RecordDeserializationException. Upgrading the consumer fixes it.

Run it: https://monedula.dev/kafka-simulator/playground/?scenario=25.1.11

## What you start with

BACKWARD, the default compatibility mode, promises that a consumer on the new schema can read data written with the old one. It promises nothing about the other direction. Here the consumer reads with a specific reader generated from v1, and the producer's new version removes a field that has no default.

## Step by step

1. **v1 · backward mode** (t+0.000s): orders-value holds v1 (schema id 1) under BACKWARD, the default. The consumer reads with a specific reader, a class generated from v1 (specific.avro.reader=true); three Schema Registry instances, sr-1 leads. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=25.1.11&t=0)
2. **O1 read with the v1 reader** (t+0.900s): O1 goes out with schema id 1. The consumer looks id 1 up, resolves the writer schema against its v1 reader and reads O1. Nothing has changed yet. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=25.1.11&t=1)
3. **v2 deployed: a field removed** (t+1.100s): The team deploys the producer with v2, which removes a field that has no default. A reader on v2 can read v1 records, it just ignores the extra field (backward), but a reader on v1 finds the field missing in v2 records with nothing to fall back to (not forward). The producer restarts with a cold schema cache. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=25.1.11&t=2)
4. **v2 accepted · the consumer stops** (t+1.500s): On the send of O2 the serializer registers v2 and the registry leader checks it against v1 under BACKWARD: compatible, so v2 is stored as schema id 2 and O2 reaches Kafka. The consumer fetches id 2, Avro cannot resolve it against the v1 reader, and poll() throws a RecordDeserializationException at offset 1. The group stops there. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=25.1.11&t=3)
5. **O3 waits behind O2** (t+2.000s): O3 is written too, and waits behind O2: the consumer keeps failing at offset 1, so its position and committed offset stay at 1 while the lag grows. Skipping the record would lose it; the reader has to change. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=25.1.11&t=4)
6. **Consumer upgraded to v2 · caught up** (t+2.800s): The consumer is redeployed with a reader generated from v2. Under BACKWARD a v2 reader reads both versions, so it reads O2 and O3 and the group catches up. This is the upgrade order BACKWARD expects: consumers first, then producers. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=25.1.11&t=5)

## The takeaway

The registry did its job: under BACKWARD a v2 reader can read every v1 record, so it accepted v2. A consumer still on v1 is the case BACKWARD does not cover, and Avro fails to resolve the v2 writer schema against its v1 reader, so poll() throws a RecordDeserializationException at the first v2 record and the group stops there. Under BACKWARD upgrade consumers first, then producers; under FORWARD the other way round. A generic reader would have read the record with the writer's schema.

## Further reading

- [Confluent documentation](https://docs.confluent.io/platform/current/schema-registry/fundamentals/schema-evolution.html)

## Troubleshooting

- [RecordDeserializationException in Kafka: causes and fixes](https://monedula.dev/kafka/troubleshooting/record-deserialization-exception/)
