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.

Where does a bad order total go?
Checkout · New sale−$48.00
Conduktor GatewayWrite blocked
Direct write
Kafka · ordersNo writeOrder published
BillingNo invoice issuedIncorrect invoice
Sales reportingRevenue unchangedRevenue understated
Checkout gets the error “Order total must be zero or greater.”Checkout gets a successful write. Both consumers receive the negative total.
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.

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 →

Data Quality Insights shows policy coverage, high-volume topics without a policy and the producers with the most violations.

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.

A Swiss Post worker unloading parcels from a yellow delivery van.

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.

Read Swiss Post’s engineering story →

“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

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?

  1. Downstream cleanup

    Finance corrects a report. The same error can still reach every other consumer.

  2. Shared visibility

    An analyst finds the offending event and takes it to the team that published it.

  3. An agreed rule

    Producers and consumers define a valid sale and test the rule against real examples.

  4. Checks at publication

    Gateway rejects writes that break the agreed rule. The publishing team handles the failure.

  5. 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.

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.

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.

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.

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.

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.