Hi! How about message contract testing of loosely...
# general
m
Hi! How about message contract testing of loosely coupled services? It is possible to test messaging contract of two mandatory pacticipants, provider sends message and consumer consumes message. But in a micro service environment with loosely coupled services, we are unable to specify who sends the message and also no message provider may be valid setup. But we would like to check if our consumer (message receiver) supports correct message format independent from a named provider. Is it possible to define a loosely coupled message contract, may be a provider wildcard?
m
at the moment, the provider must be known in advance. It’s just a name, and if the implementation changes later on the “true” (new) provider can just take over that name and verify it as needed
m
Thanks for your fast reply! By the way in our case it is 1:n relation, so in future we have multiple provider for this message. But currently our problem is, provider name is not just a name, because can-i-deploy pipeline step checks if provider exists inside cluster and pact-broker says NO. 😞 So our quick solution was to remove this pact consumer-provider-pair and we are unable to ensure working messaging format.
m
But currently our problem is, provider name is not just a name, because can-i-deploy pipeline step checks if provider exists inside cluster and pact-broker says NO. 😞
of course. Unfortunately that’s a problem with message tests in Pact at the moment. You can’t deploy a consumer of a message if the producer (provider) doesn’t exist.
Unlike REST, where that would be a problem, it’s not uncommon for a consumer to “wait” until the producer comes online
m
Are there any plans to support this messaging scenario?
m
No concrete plans at this stage. Check https://pact.canny.io/, I believe there is a feature request there somewhere