If I want to test my microservices with consumer driven contracts one of the first things to do is to identify who is the consumer and who is the provider. That sounds simple on the first glance but gets tricky when it mets the real world.
In our example we have a service which provides an interface which accepts data (via HTTP-put) and store it into some datastore. Now we have two different views on this system. The first one is to define this service as the provider who offers an API. So each client of this services defines it's expectations to this servcies as a contract. The second way to look at this system is to say that this service is the client which consumes the data. So this data-consuming service defines the contract.
I tend to the first interpretation which is more "API-centric" while the second one is more "data-centric".
Is there any technique which helps me identify my consumer and my provider for consumer-driven-contracts?
Aucun commentaire:
Enregistrer un commentaire