- Java 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/workflows | ||
| .mvn/wrapper | ||
| .run | ||
| docker | ||
| src | ||
| .gitignore | ||
| .trivyignore | ||
| CHANGELOG.md | ||
| CONTRIBUTING.md | ||
| exclude-patterns.txt | ||
| LICENSE | ||
| mvnw | ||
| pom.xml | ||
| publiccode.yml | ||
| README.md | ||
| SECURITY.md | ||
| THIRD-PARTY-LICENSES.md | ||
Message Contract Service
This example project shows how to assemble a runnable
Message Contract Service instance using the
jeap-message-contract-service-instance starter, backed by a PostgreSQL database.
What this example demonstrates
The Message Contract Service tracks, per application and topic, which message types producers publish and
consumers expect (a "contract"), checks compatibility between producer and consumer contracts against message
schemas resolved from a message type registry
git repository, and records which contract version is deployed to which environment so incompatible deployments
can be detected before they happen. The integration test (MessageContractServiceExampleIT) exercises the full
workflow end to end:
- Registering a producer's message contracts (
PUT /contracts/{app}/{version}, rolePRODUCER). - Registering a consumer's message contract for the same message type/topic (role
CONSUMER). - Registering a consumer contract for an incompatible topic, to later demonstrate a compatibility failure.
- Registering a deployment of the producer to an environment (
PUT /deployments/{app}/{version}/{env}). - Checking deployment compatibility for the compatible consumer (
GET /deployments/compatibility/...→200 OK). - Checking deployment compatibility for the incompatible consumer (→
412 Precondition Failed). - Listing all recorded deployments (
GET /deployments).
Installing / Getting started
Run the application with the local profile:
./mvnw spring-boot:run -Dspring-boot.run.profiles=local
The local profile starts the PostgreSQL database from docker/docker-compose.yml automatically through Spring Boot
Docker Compose. Docker must be running before starting the application.
You can also start the database manually, for example when you want to keep it running across application restarts:
cd docker && docker compose up
Then start the application with the same Maven command shown above and access swagger at Message Contract Service API
The integration test follows the jEAP example structure and starts the service with the shared
BootServiceSpringIntegrationTestBase.
It starts the Docker Compose database through Spring Boot's Docker Compose support, so Docker must be available when
running the integration test:
./mvnw verify
Note
This repository is part of the open source distribution of JME. See github.com/jme-admin-ch/jme for more information.
License
This repository is Open Source Software licensed under the Apache License 2.0.