Quick revision
The short answer
I would declare that any event published outside its team is a public contract, with a named owner, versioning rules and a deprecation period, exactly like a public API. Schemas live in a registry or catalogue with compatibility checks enforced in CI, consumer discovery tells producers who depends on each event, and governance stays lightweight, automated checks and clear rules rather than a review board for every change. We then measure breaking-change incidents to see whether the model works.
What to remember
In this answer, we saw that events shared outside a team must be treated as public contracts with owners, versioning rules and deprecation periods. A schema registry or catalogue with compatibility checks in the producer's CI catches breaking changes before deployment, consumer discovery tells producers who depends on each event, and lightweight governance, automation and clear rules with human review only for new and breaking cases, keeps teams fast. Counting breaking-change incidents shows whether the model works.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would declare that any event published outside its team is a public contract, with a named owner, versioning rules and a deprecation period, exactly like a public API. Schemas live in a registry or catalogue with compatibility checks enforced in CI, consumer discovery tells producers who depends on each event, and governance stays lightweight, automated checks and clear rules rather than a review board for every change. We then measure breaking-change incidents to see whether the model works.
Why this question is asked
When events become the main way services talk to each other, they carry the same weight as public APIs, but they often lack the same discipline. A REST API has an OpenAPI document, a version and clients who complain loudly; an event has a producer who sees no direct callers and changes a field on a Friday. Interviewers ask this leadership question to see whether we can introduce governance that actually prevents breakage without turning every change into a meeting. In this answer, we will set out what makes an event a contract, design the tooling for schemas and compatibility, add consumer discovery, keep the process lightweight, and decide how to measure success.
1Why Events Break Consumers Without Notice
An event producer does not know its consumers. Anyone with read access to a topic can subscribe, and nothing tells the producer that eight services now depend on a field. So a change that looks local, renaming customerName, changing a number to an object, starts failing consumers the moment the producer deploys, often in another team's on-call shift.
The underlying problem is ownership and visibility, not carelessness. The producer has no list of dependants, no rule for what counts as breaking, and no automated check. Governance has to supply those three things.
2Events Shared Outside a Team Are Public Contracts
The first rule draws a line. Events used only inside a team's own services are internal, and the team changes them freely. Events consumed by any other team are public contracts. A public event has a named owning team, a schema, a documented meaning for each field, and follows the versioning rules: additive changes, new optional fields, are allowed at any time; breaking changes, removing, renaming, retyping or changing meaning, require a new version and a deprecation period, say ninety days, during which both versions are published.
Making the line explicit matters, because it keeps governance away from the many internal events where it would only slow teams down, and puts it firmly on the ones that cross team boundaries.
| Topic | Rule |
|---|---|
| Owner | one named team, listed in the catalogue |
| Schema | registered; every field documented |
| Additive change | allowed, checked automatically |
| Breaking change | new version, both published in parallel |
| Deprecation | at least 90 days, consumers notified |
| Retirement | only when no registered consumer remains |
3Schemas and Compatibility Checks in CI
Every public event's schema lives in a schema registry, Confluent Schema Registry, Apicurio or similar, or in a catalogue repository if the company uses JSON without a registry. The registry is configured with a compatibility mode per event, typically BACKWARD or FULL with the transitive option for long-retained topics, so it rejects a schema version that would break readers.
The key is enforcement at build time. The producer's CI pipeline registers or tests the new schema against the registry before deployment, and a breaking change fails the build with a message pointing to the versioning rules. Teams find out in their pull request, not in production. The runtime serializer, configured to use registered schemas only, is a second line of defence.
- Producer edits the schemain a pull request
- CI checks compatibility against the registryBACKWARD or FULL mode
- Compatible?YesMerge and deploy, consumers unaffectedNoBuild fails with a link to the rules
- Breaking change needed?YesPublish a new version in parallelNoRework as an additive change
- Notify registered consumersdeprecation date for the old version
5 steps in order. Play them, or step through them one at a time.
The check runs in the producer's build, so the producer sees the break first.
4Consumer Discovery: Knowing Who Depends on an Event
A producer cannot negotiate with consumers it does not know. So consumer discovery is part of the model. The simplest version is registration: a consumer declares in the catalogue which events and versions it uses, which can be automated from the consumer's own configuration or schema dependencies in its build. A complementary version comes from the platform: broker access control lists and consumer group metrics show which services actually read each topic.
With discovery, deprecation becomes concrete. The producer sees eight consumers on version 1, notifies their owners, and watches the count drop to zero before retiring it, rather than guessing and hoping.
5Keeping Governance Lightweight
The temptation is an architecture review board that approves every event change. That fails at scale: changes queue for a weekly meeting, teams work around the process, and the board becomes the bottleneck it was meant to prevent. Most changes are additive and safe, and a machine can tell.
So the model is automated checks plus clear rules, with humans only where judgement is needed: a short review for new public events, to check naming and meaning, and for breaking changes, to agree the migration plan. A small group of event champions from several teams maintains the rules and the tooling and helps teams with difficult changes, rather than gatekeeping them.
6Measuring Whether It Works
We define the outcome we want and count it. The main measure is the number of incidents caused by breaking changes to events per quarter, which should fall sharply after the checks are in place. Supporting measures are the share of public events registered with an owner and schema, the share with registered consumers, and how many builds the compatibility check rejected, which shows how many incidents it prevented.
If incidents continue, the measures show where: unregistered events, consumers that are not tolerant readers, or meaning changes that no schema check can catch. Each points to a specific improvement rather than more process.
7Follow-up questions
How do we handle a change in meaning that keeps the same schema?
No schema check can detect it, so the rules must say that changing a field's meaning or units is a breaking change requiring a new field or version. Field documentation in the schema, including units such as cents, makes the meaning explicit and gives reviewers something to compare.
What about teams that use JSON without schemas?
We ask them to describe public events with JSON Schema in the catalogue, and we provide a CI plugin that compares the schema with the last published version. Producing JSON from a typed class makes generating the schema easy, so the cost to the team is small.
Who decides when a deprecated version is retired?
The owning team, once registered consumers have migrated and the deprecation period has passed. If a consumer has not moved, the event champions help resolve it, and escalation to engineering management is the last resort, so the producer is not blocked forever.
8Conclusion
In this answer, we saw that events shared outside a team must be treated as public contracts with owners, versioning rules and deprecation periods. A schema registry or catalogue with compatibility checks in the producer's CI catches breaking changes before deployment, consumer discovery tells producers who depends on each event, and lightweight governance, automation and clear rules with human review only for new and breaking cases, keeps teams fast. Counting breaking-change incidents shows whether the model works.
Open with
I would treat every event consumed outside its owning team as a public contract, like a public API. That means a named owning team, a registered schema with documented fields, and clear rules: additive changes like a new optional field are always allowed, while removing, renaming, retyping or changing the meaning of a field requires a new version published in parallel for a deprecation period of, say, ninety days.
Then, if they want more
Internal events stay free, so governance only applies where it is needed. The rules are enforced by tooling: schemas live in a schema registry or catalogue with a compatibility mode, and the producer's CI checks each change against it, so a breaking change fails in the pull request rather than in another team's on-call.
I would add consumer discovery, consumers register the events they use and broker metrics confirm who reads what, so producers can notify and track migration before retiring a version. I would avoid a review board for every change, because most changes are safe and a machine can tell; humans review only new public events and breaking changes.
And I would measure incidents from breaking event changes per quarter, along with schema and consumer registration coverage, to see whether the model is working.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Apache Kafka documentation, Spring for Apache Kafka reference
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Event contracts in your company have become as important as public APIs, but they change...": https://scrivio-interview-library.netlify.app/spring-boot/event-driven-patterns/87c3f2fa71/