I'm doing an research-project where I'm researching the options to handle changes in an event-driven microservice architecture.
So, let's say we got an application where we got four different services. Each of these services has an own database to store local data.
In this setup, the four services communicate with each other using an Event Bus. So when something happens in a service, it publishes an event. All the other services that are interested in that event will process it in their own way.
In that case the different services in the architecture need to have "contracts" about the content of these events (attributes etc.). So services have a "loosely coupled dependencies" to these events
My question is: How can we handle changes in these events?
So, let's say service A registers new users in the application. So it sends an " "UserRegistered" event. Service B picks up that event and processes it. But some developer on the team of service C decided that they also need a gender of a registered user. So the event is changed and the attribute gender is added to the "UserRegistered" event.
How can we make sure that Service B can still pickup the same event with that extra attribute without redeploying?
And are there other ways to approach this problem then versioning these events?