How Messaging Pacts work
masterMessaging pacts allow a consumer and a producer to agree on the structure of messages (including metadata and content) without requiring a specific transport protocol like HTTP.
Key Concepts:
- Consumer: Defines the messages it expects to receive.
- Producer: Is verified to ensure the messages it produces match the consumer's expectations.
- Transport Agnostic: PactNet does not implement specific transports (like Kafka, RabbitMQ, or ZeroMQ). Instead, messages are simulated internally during the provider verification stage.
Important Constraint: To avoid conflicts, ensure that a consumer or provider name is not used for both request/response (HTTP) pacts and messaging pacts. If a service uses both, use distinct names, for example:
Stock Broker API(for HTTP)Stock Broker Messaging(for messages)