Hi team, This is the example of message pact cons...
# pact-net
j
Hi team, This is the example of message pact consumer test, my understanding is that it defined the expected message from the MQ, but do we have code to define the message/data that consumer put onto the MQ?
m
Is this a req/response message?
If so, that’s a new thing in the Pact V4 spec, I don’t think Pact .NET supports it yet
j
@Matt (pactflow.io / pact-js / pact-go)@Matt (pactflow.io / pact-js / pact-go)@Matt (pactflow.io / pact-js / pact-go) it is for event driven, message pact not for request/response
@Matt (pactflow.io / pact-js / pact-go)@Matt (pactflow.io / pact-js / pact-go)@Matt (pactflow.io / pact-js / pact-go) I think Pact Net supports it, the code I got is from master branch sample
m
but do we have code to define the message/data that consumer put onto the MQ
are you putting something onto a queue and then expecting a response?
j
@Matt (pactflow.io / pact-js / pact-go)@Matt (pactflow.io / pact-js / pact-go)@Matt (pactflow.io / pact-js / pact-go) but the sample code only defined the expected incoming message from provider, I don't know how to define the message coming from consumer side
Yes, that’s what I want to do
m
Currently, if you want to do that, you need to write a similar test from the perspective of the other side of the queue (i.e. you’re a message producer in this case)
the V3 message support is async only (fire and forget)
You want req/response, which is a V4 feature and only just starting to be rolled out in other languages.
j
But this sample code is from V4+, and it is for message pact
m
Apologies for the confusion. It just so happens that the latest Pact NET is 4.x.x
I’m referring to the Pact Specification (currently at V4)
The Pact specification is an ecosystem wide spec
j
No worries mate, so back to my question, how could my consumer test simulate putting message on to the queue?
👍 1
m
Currently, if you want to do that, you need to write a similar test from the perspective of the other side of the queue (i.e. you’re a message producer in this case)
But realistically, that won’t quite do it because it’s not properly paired
j
Hmm, my understand is that the sample consumer test only defined the response from queue (event consumer)
m
correct
so you’d need to write the test from the perspective of the other side of the queue (they are now the consumer, and you the provider)
j
Ok, I will try, not sure how the contract would be…still from consumer side (event producer)?
m
Both sides would need to be a consumer and provider in this scenario.
In the request cycle,
A
is the message provider, and
B
is the consumer:
A
->
MQ
->
B
In the response cycle,
B
is the message provider and
A
is the consumer
A
<-
MQ
<-
B
(As I said, not ideal, req/response messages is coming soon)
j
Cool, thanks very much for your explanation, I think I will wait for the incoming feature 😄 do you know when? Or how could I know the new feature is released?
m
I don’t think there is a feature request raised yet on the Pact .NET issues register. I’ll aim to get that up. But you can follow our (Pactflow’s) commitment to it here: https://github.com/pactflow/roadmap/projects/1
j
Excellent, thank you so much for your help, do appreciate :)
m
🙌
t
I really like how shiny this screen is
😆 2