1

How hard is it to make pact-jvm support protocols other than HTTP, such as Thrift (https://thrift.apache.org)? In other words, is the implementation of pact-jvm tightly coupled to HTTP? Thanks.

Matthew Fellows
  • 3,669
  • 1
  • 15
  • 18
jduan
  • 2,784
  • 2
  • 15
  • 9

1 Answers1

2

Pact currently only works with HTTP. If Thrift is used over HTTP (which I believe it does), then you should be able to use it. Most of the useful matching with Pact is done with JSON, and I believe Thift uses a form of JSON as well, so you should be ok there.

See this issue about using Pact with Thrift: https://github.com/DiUS/pact-jvm/issues/158

As to other protocols or message formats, there is less support. We (some of the core contributors) have been discussing making it more protocol agnostic. But it would require implementations for each protocol to be able to compare the payloads and provide good feedback when differences occur.

  • Thanks, Ronald! Thrift supports different protocols and transports. JSON over HTTP is one of them. However, the more common use case is Binary over TCP (very efficient). See https://thrift.apache.org/docs/concepts I've been looking at https://github.com/DiUS/pact-jvm. To extend it to support Thrift, where are the major extension points? Can you give me some high-level overview? Thanks again. – jduan Apr 28 '17 at 21:47
  • The first thing that needs to be done is extended the specification to include information about the protocol. Then a protocol implementation needs to be developed that can parse, generate and compare the payload of the protocol. – Ronald Holshausen May 02 '17 at 22:51