Demo: changing OrderPlaced without breaking consumers
On This Lesson 3 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
replace total (cents, long) with money (amount, currency) safely. Prepares MID-062-LAB1.
Draft outline details
Step by step
- Show current Avro schema v1 and the registry set to BACKWARD_TRANSITIVE (or FULL).
- Add
moneywith a default and keeptotal; register v2; the check passes. - Deploy the producer to emit both fields; consumers on v1 keep working.
- Planned mistake: remove
totalin the same change; the registry rejects it (or a contract test fails). Fix: keep it for a release. - Migrate consumers to
money; watch usage oftotalfall to zero. - Register v3 removing
totalafter the deprecation window.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.