Hi, my team has a library for reusing common code ...
# pact-jvm
k
Hi, my team has a library for reusing common code across our microservices. One of the modules is a http client for interacting with a service named
foo
. We have written consumer contract tests within this module, however, I’m not sure where to go from here. We could publish the pacts to the broker but that would just prevent the module from going out of sync with
foo
. We don’t record deployments of the module because it isn’t a service. So this wouldn’t help to prevent the services from going out of sync with
foo
. What we actually want to do is publish pacts for multiple services, services who happen to be using the module, to prevent them from going out of sync with the
foo
service. I’m not sure where we’re going wrong so any help would be greatly appreciated. Thanks 🙂
m
Could you distribute (i.e. include in the package) a generated pact file from the module, that each service that uses it then publishes to PactFlow? Then you could record deployments for each of the microservices that use the module, protecting them. The downside is that you’d lose fidelity of which endpoints and fields they use, but that might be a compromise you’re willing to have
k
Thanks for the suggestion, in the end the team was happy to modify the library so that the client could be exposed so we’re now able to write the usual unit test level consumer contract tests and keep the same level of granularity 🙂
nice 7771 1
m
got it - thanks for coming back and sharing with us 🙂