Currently we have Event class in common, it may force event consumer microservice to upgrade its common module when event publisher upgrades format of event. This means that event consumer microservice lacks control of its dependency.
Instead, we can use common class like JsonObject as event class. Then we can eliminate these dependencies.
It is also good to call multiple versions of REST API; one microservice may call multiple versions of one API, and if we use class, we need multiple event classes like FooEventV1 & FooEventV2.
Currently we have Event class in common, it may force event consumer microservice to upgrade its common module when event publisher upgrades format of event. This means that event consumer microservice lacks control of its dependency.
Instead, we can use common class like JsonObject as event class. Then we can eliminate these dependencies. It is also good to call multiple versions of REST API; one microservice may call multiple versions of one API, and if we use class, we need multiple event classes like
FooEventV1
&FooEventV2
.