Read-only mirror of https://github.com/jme-admin-ch/jme-message-contract-service — Bundesamt für Informatik und Telekommunikation. Issues & pull requests at the source. Catalog: https://www.opensource.admin.ch/en/softwares/7osgfa https://www.opensource.admin.ch/en/softwares/7osgfa
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-25 01:09:55 +02:00
.github/workflows JEAP-7322 Adapted github build workflow 2026-07-30 07:47:57 +02:00
.mvn/wrapper chore(deps): update dependency maven to v3.9.16 2026-07-11 06:01:05 +00:00
.run JEAP-6504 2026-07-10 15:04:56 +02:00
docker chore(deps): update repo.bit.admin.ch:8444/postgres docker tag to v18.6 2026-08-14 23:01:13 +00:00
src JEAP-6504 2026-07-10 15:04:56 +02:00
.gitignore JEAP-6504 2026-07-10 15:04:56 +02:00
.trivyignore JEAP-6504: * Add Jenkinsfile 2026-07-09 15:25:22 +02:00
CHANGELOG.md chore(deps): update dependency ch.admin.bit.jeap.jme:jme-spring-boot-integration-test to v6.0.1 2026-08-24 23:01:48 +00:00
CONTRIBUTING.md JEAP-6504 2026-07-10 15:04:56 +02:00
exclude-patterns.txt JEAP-6504 2026-07-10 15:04:56 +02:00
LICENSE JEAP-6504 2026-07-10 15:04:56 +02:00
mvnw JEAP-6504: * Add Jenkinsfile 2026-07-09 15:25:22 +02:00
pom.xml chore(deps): update dependency ch.admin.bit.jeap.jme:jme-spring-boot-integration-test to v6.0.1 2026-08-24 23:01:48 +00:00
publiccode.yml Update version/date in publiccode.yml 2026-08-25 01:09:55 +02:00
README.md [skip ci] JEAP-7451: update documentation 2026-08-24 16:09:19 +02:00
SECURITY.md JEAP-6504 2026-07-10 15:04:56 +02:00
THIRD-PARTY-LICENSES.md JEAP-6504 2026-07-10 15:04:56 +02:00

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:

  1. Registering a producer's message contracts (PUT /contracts/{app}/{version}, role PRODUCER).
  2. Registering a consumer's message contract for the same message type/topic (role CONSUMER).
  3. Registering a consumer contract for an incompatible topic, to later demonstrate a compatibility failure.
  4. Registering a deployment of the producer to an environment (PUT /deployments/{app}/{version}/{env}).
  5. Checking deployment compatibility for the compatible consumer (GET /deployments/compatibility/...200 OK).
  6. Checking deployment compatibility for the incompatible consumer (→ 412 Precondition Failed).
  7. 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.