Imagine we have a microservice M1 with an aggregate root called Player
and a microservice M2 with an aggregate root called Classification
, now in the M1 we need to do some logic based on some property from Classification
, now some steps to do that are:
- Replicate the list of possible Classifications to M1 via asynchronous messaging;
- Do what is asked by the business in M1;
Ok, now imagine we have a view to add Players, and in that view is possible to choose the Classification
of the new Player
from a dropdown list. Now the question:
Should the dropdown list be populated with the Classifications that were replicated into M1 or from M2?
As you can see, by using the data from M1 we would have to expose the Classification
from M1 via an API, thus the title of the question.
EDIT
The replications happens through async messaging using events, so I'm not exposing the entire aggregate to M1 just some properties like an Id and the Description of the classification.