pact-specification icon indicating copy to clipboard operation
pact-specification copied to clipboard

Introduce message queue support

Open mkozjak opened this issue 8 years ago • 18 comments

Since the approved spec for v3 is here and it includes messages support, a possible support for message queue protocols should be made.

There should probably be a factory for that, which would make different queueing protocols possible to implement and use. In example, AMQP, NATS, etc.

mkozjak avatar Oct 13 '16 05:10 mkozjak

Any progress here?

mkozjak avatar Dec 21 '16 22:12 mkozjak

Sorry @mkozjak, none that I know of.

bethesque avatar Dec 22 '16 23:12 bethesque

The only work done in this area is with the JVM version and the Rust shared library. The idea with the shared library is that that can be used in other language implementations (JS, Ruby, Python, .NET, etc.)

uglyog avatar Dec 28 '16 22:12 uglyog

As discussed with @mefellows I'd (my employer) be willing to help with NodeJS version that supports RabbitMQ and gRPC on top of the HTTP that exists already. We're not a Ruby shop so would prefer JS

TimBailey-pnk avatar Mar 20 '17 00:03 TimBailey-pnk

FWIW the current strategic implementation of this would look something as follows:

  • Complete the v3 specification in Rust (both consumer and provider) - this is ~70%+ complete
    • This implies design work on how the interaction between the client and native library is completed
  • Refactor JS / other implementation DSLs
  • Embed shared library into implementations, starting with JS

mefellows avatar Mar 21 '17 21:03 mefellows

Any update on this?

gerrymcgovern1 avatar May 08 '18 03:05 gerrymcgovern1

Hi all,

I'm pleased to announce a bit of an update on this:

  • We now have a shared Ruby package with the minimal v3 implementation required to make messages (and other async things) work
  • We have beta versions of Pact JS and Pact Go with working examples

We'll be rolling these into all languages over the coming months.

cc: @gerrymcgovern1

mefellows avatar May 08 '18 04:05 mefellows

Can you answer, please? When you will start and finish implementation of pact-v3 for php(approximately)?

arkonchik avatar May 11 '18 16:05 arkonchik

We don't have specific dates, and we've already indicated approximate timelines. You could reach out to the contributors on pact php directly. Even better, help with it's development?

mefellows avatar May 11 '18 23:05 mefellows

Thanks for reply

arkonchik avatar May 14 '18 07:05 arkonchik

Any news? Any progress on Python?

singlaive avatar Feb 28 '19 13:02 singlaive

You'll need to reach out to the python library maintainers to let them know you're interested. The underlying code is done in the shared library.

bethesque avatar Feb 28 '19 20:02 bethesque

Hello, Does Spec v3 support MessageQueue for PACT Java? I saw that she no longer has the @PactVerification annotation that calls the build method for message consumption.

klyff avatar Jun 29 '20 21:06 klyff

Yes, Pact JVM definitely still supports messages. There are a few examples in the github repository

e.g. https://github.com/DiUS/pact-jvm/blob/master/consumer/groovy/src/test/groovy/au/com/dius/pact/consumer/groovy/messaging/PactMessageBuilderSpec.groovy and https://github.com/DiUS/pact-jvm/blob/master/consumer/junit5/src/test/java/au/com/dius/pact/consumer/junit5/AsyncMessageTest.java and

mefellows avatar Jun 29 '20 23:06 mefellows

Does the specification support routing keys in any form? Ex. RabbitMQ would require specifying the destination exchange and routing key separately.

EvgheniiShipilov avatar Feb 19 '21 15:02 EvgheniiShipilov

Yes, it supports it via metadata (otherwise we'd need queue specific fields in the spec, which is not ideal). You'll need to look at the language specific docs for how this is done.

mefellows avatar Feb 20 '21 00:02 mefellows

Yes, it supports it via metadata (otherwise we'd need queue specific fields in the spec, which is not ideal). You'll need to look at the language specific docs for how this is done.

What happens if we use pact to integrate 2 different language application? Shouldn't there be a language agnostic way to specify destination between services?

EvgheniiShipilov avatar Feb 23 '21 11:02 EvgheniiShipilov

Yes, of course! The specification has them stored in the metaData field of the output contract. But that doesn't help you work out how to get it in there in the first place.

Each language has its own way of doing this (and not all languages support message pact).

e.g. in Pact JVM: https://docs.pact.io/implementation_guides/jvm/provider/junit/#example-of-message-test-that-verifies-metadata

mefellows avatar Feb 23 '21 11:02 mefellows

Closing now as message async/sync message support available in v4

Users can create their own plugins using the pact plugin framework to cover transport and matching semantics for specific protocols

https://docs.pact.io/plugins/quick_start

There are some existing plugins available

https://docs.pact.io/plugins/directory

and some have been created by users for in-house use only (not open sourced)

for implementations in respective languages, please see their repos and raise an issue if it is not implemented.

please also be aware that we are open source maintainers, so the best way to get it implemented, is to do it yourself!

People will be happy to guide, so just reach out.

Asking when something will be done, will probably not get you very far :)

YOU54F avatar Jun 25 '24 23:06 YOU54F