# Keep bad data out of Kafka

Conduktor Gateway applies the same topic rules to every producer that writes through it. Stop an invalid record before it reaches consumers and see which producer sent it.

Without Gateway, Kafka accepts the negative order total. Billing issues an incorrect invoice and Sales reporting understates revenue. With Conduktor Gateway, the order policy blocks the write before Kafka receives it. Checkout gets an error and neither consumer receives the invalid order.

[Watch the data quality demo](https://www.conduktor.io/product-demos/block-bad-data-with-data-quality-enforcement)
[Talk to Us](https://www.conduktor.io/contact/demo?src=solutions-use-case-streaming-data-quality)

## Why validate records in the proxy?

- **Reject a −$48 sale** even if its schema ID is valid.
- **One rule** covers every producer behind Gateway.
- **Validate plain JSON** without a schema registry.
- **Console** shows policy gaps and who sent bad data.

[Explore write-time validation →](https://www.conduktor.io/blog/kafka-data-quality)

![Data Quality Insights shows policy coverage, high-volume topics without a policy and the producers with the most violations.](https://www.conduktor.io/assets/images/releases/january-2026-data-quality.png)

## How Swiss Post tracks down bad data

Kafka carries sorting instructions across Swiss Post’s delivery network. As adoption grew from 60 to more than 300 applications, teams could check an event’s format and still disagree about what its contents meant.

### From a failed check to the message behind it

Anke Raich’s platform team built a Grafana dashboard to track schema validity. An analyst investigating an anomaly can open the affected message in Conduktor Console and inspect the data within their own permissions.

> “Then you can click on the message, which takes you through to Conduktor to drill down further—to investigate more deeply and to correlate any possible problems.”

**Anke Raich** · Platform Team Lead, Swiss Post

[Read Swiss Post’s engineering story →](https://www.conduktor.io/customer-stories/how-swiss-post-governs-democratizes-kafka-usage)

## Where does your team catch a bad event?

Think about the last error a customer or analyst spotted. How far did it travel before someone who could fix it found out?

- **Downstream cleanup** — Finance corrects a report. The same error can still reach every other consumer.
- **Shared visibility** — An analyst finds the offending event and takes it to the team that published it.
- **An agreed rule** — Producers and consumers define a valid sale and test the rule against real examples.
- **Checks at publication** — Gateway rejects writes that break the agreed rule. The publishing team handles the failure.
- **Quality in every release** — Teams test contract changes with consumers before release and reuse proven rules across streams.

## Which orders should reach Billing?

Checkout and Billing agree that a new sale can total zero after a discount. A refund can be negative. Those two examples belong in the data contract before anyone turns on blocking.

- **Test the boundary** — Run a paid order, a fully discounted order and a refund through the proposed rule. Both teams should agree on which events pass and why.
- **Give the error an owner** — Route the producer’s writes through Gateway. A blocking rule rejects the Kafka batch. Have Checkout rehearse correcting the bad order and resubmitting the affected records.
- **Measure the outcome** — Track how often Billing still has to correct an invoice and how long Checkout takes to fix a rejected write. A rejection count alone tells you little about either.

## Planning your first quality policy

**Can we start with Console alone?**

Yes. Console can detect rule violations after records reach Kafka. Routing producers through Gateway adds producer attribution and lets you mark or block writes before they reach the topic. [See where quality policies run](https://docs.conduktor.io/guide/conduktor-concepts/data-quality-policies).

**What does Confluent’s broker-side schema ID check cover?**

It verifies that the record references a schema registered for the expected subject. A topic policy can also check field values, such as whether a new sale has a nonnegative total. [Read Confluent’s schema ID validation reference](https://docs.confluent.io/platform/current/schema-registry/schema-validation.html).

**Do plain JSON producers need Confluent Schema Registry?**

No. Attach a JSON Schema rule to the topic and send the existing JSON payloads through Gateway. Producers and consumers keep their current wire format. [See an example JSON policy](https://www.conduktor.io/blog/bounce-bad-kafka-data-with-json-schema-rules).

**How do we cover every producer on a protected topic?**

Point its producers and source connectors at Gateway and restrict direct writes to the brokers. A client that can still publish directly can bypass the policy.

**What if a value is unusual but might be valid?**

Start by observing it. If consumers need to know about the exception as they process the event, Gateway can mark it with a header and let it through. Reserve blocking for cases where the owners agree that accepting the event would cause more harm. [Explore marking and blocking](https://docs.conduktor.io/guide/use-cases/enforce-data-quality).

# Which event would you catch earlier?

Bring a recent data incident. We’ll trace it from the producer to the teams it affected and work out where a check would have made a difference.

[Talk to Us](https://www.conduktor.io/contact/demo?src=solutions-use-case-streaming-data-quality)
