You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our platform we have the concept of an 'adaptor' microservice to intermediate between each 3rd party providing the same capability. All adaptors are required to provide (shared) consumers with a consistent external contract - the mapping to each 3rd party is then isolated within each adaptor.
What's the best way of using Pacts to test the same contract against each adaptor? Our initial ideas are below.
We could make our consumer Pact tests aware of each producer (adaptor). The tests could iterate through each adaptor, generating multiple Pact files, or we could modify the Pact implementation to generate multiple identical pact files given an array of producers. This has the downside that we have to modify our consumer(s) source (albeit trivially) when we add a new adaptor. Not great as we want to scale to ~200 3rd parties.
Use something other than Pact. We could validate the adaptor against our Open API spec, potentially as part of run-time monitoring. In that case we would then run consumer Pacts only against a stub or template implementation of our adaptor, which is auto-generated from our Open API spec.
Any other ideas?
The text was updated successfully, but these errors were encountered:
At a scale of 200 consumers, I don't think pact is the best option. Its purpose is to allow the consumers' requirements to drive the provider implementation, and to allow rapid changes with confidence to the provider, avoiding the traditional versioning approach. It's sweet spot is internal APIs. With 200 consumers, you're basically a public API, and you're going to have to provide stable versions, and move at a slower pace because there's no way 200 codebases will be able to keep up with rapid change. Driving out the requirements will be more of a long winded people process rather than a "lets have a quick chat and whip up a potential contract" kind of process.
In our platform we have the concept of an 'adaptor' microservice to intermediate between each 3rd party providing the same capability. All adaptors are required to provide (shared) consumers with a consistent external contract - the mapping to each 3rd party is then isolated within each adaptor.
What's the best way of using Pacts to test the same contract against each adaptor? Our initial ideas are below.
We could make our consumer Pact tests aware of each producer (adaptor). The tests could iterate through each adaptor, generating multiple Pact files, or we could modify the Pact implementation to generate multiple identical pact files given an array of producers. This has the downside that we have to modify our consumer(s) source (albeit trivially) when we add a new adaptor. Not great as we want to scale to ~200 3rd parties.
Use something other than Pact. We could validate the adaptor against our Open API spec, potentially as part of run-time monitoring. In that case we would then run consumer Pacts only against a stub or template implementation of our adaptor, which is auto-generated from our Open API spec.
Any other ideas?
The text was updated successfully, but these errors were encountered: