spring-cloud-contract-samples | Samples for Spring Cloud Contract project
kandi X-RAY | spring-cloud-contract-samples Summary
kandi X-RAY | spring-cloud-contract-samples Summary
This repository contains the consumer and the producer applications to use with Spring Cloud Contract project. It contains several important branches. master where we test against the latest versions of Spring Cloud Contract, and x.x.x where we test against x.x.x version of Spring Cloud Contract. This repository shows examples of. Both for REST and Messaging. Built with Maven and Gradle. Also some additional Spring Cloud Contract plugin configuration is present. These samples were used in the following presentation. It might help to use the samples. You can also go through the Spring Cloud Contract Workshops to learn how to use the tool by example.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Start the downloader .
- Gets the check method .
- Extracts the authentication token from the given map .
- Defines the definition of the PersonToCheck field .
- Get Grumpy response
- Performs a GIMme request to GSM .
- Gets the serializedSize property .
- Process a verification .
- Create a Kafka listener container factory .
- Bean route .
spring-cloud-contract-samples Key Features
spring-cloud-contract-samples Examples and Code Snippets
Community Discussions
Trending Discussions on spring-cloud-contract-samples
QUESTION
Design Overview
- Request and response objects are modelled in protobuf.
- Classes are generated in Python and Java using protoc.
- Users create request objects in Python and send it to RESTful Java Spring Boot microservices.
- A JavaScript React web application and Node server also invoke the RESTful endpoints.
- Requests and responses are serialized to Json.
- 1+ Java microservices may use the same request/response objects. eg. an aggregator/API gateway microservice will pass on the request to the actual microservice, providing the relevant service.
Question
Protobuf enforces some level of type checking, and a kind of contract, for request/response objects. However, how do I develop, maintain and enforce RESTful contracts (HTTP verb + path + request + response)?
Is this the way to go?
Develop contracts in Spring Cloud Contract and auto-generate integration contract tests.
...ANSWER
Answered 2020-Jun-26 at 08:42You can check out a sample that uses protobuffers with spring cloud contract on the producer side here https://github.com/spring-cloud-samples/spring-cloud-contract-samples/tree/master/producer_proto and on the consumer side here https://github.com/spring-cloud-samples/spring-cloud-contract-samples/tree/master/consumer_proto
The very idea is to treat the content as binary. Let's say that I stored the request and response in a binary format in a .bin file. Then I can create the following contract
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install spring-cloud-contract-samples
common
beer-contracts
producer
producer_advanced
producer_with_external_contracts
producer_with_stubs_per_consumer
consumer
consumer_with_discovery
producer_with_restdocs
consumer_with_restdocs
consumer_with_stubs_per_consumer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page