Asynchronous Message Support
We are excited to announce that support for verifying asynchronous message interactions has been added in the recent release of Pact Python version 2.2.1. To explore this feature, use the pact.v3
module. A huge shoutout goes to Val Kolovos who contributed this feature across two very large PRs (#714 and #725). This represents a significant step forward in the capabilities of Pact Python and on the road to full support for the Pact specification.
Asynchronous messages play a crucial role in building resilient and scalable systems. They allow services to communicate with each other without blocking, which can be particularly useful when the sender and receiver are not always available at the same time. However, verifying these interactions is challenging due to the wide variety of messaging systems and protocols.
Pact simplifies this process by focusing on the content of the messages rather than their transport mechanisms. This approach allows defining expected message exchanges and verifying their adherence independently of messaging systems and protocols. For a more comprehensive view of non-HTTP contract testing, have a look over at docs.pact.io. The Pact specification provides a way to verify these interactions, but until now, Pact Python support for this feature was incomplete at best.