Watch
1
0
Fork
You've already forked jme-reaction-observer-service-example
0
Read-only mirror of https://github.com/jme-admin-ch/jme-reaction-observer-service-example — Bundesamt für Informatik und Telekommunikation. Issues & pull requests at the source. Catalog: https://www.opensource.admin.ch/en/softwares/rgr8h https://www.opensource.admin.ch/en/softwares/rgr8h
  • Java 97.3%
  • Shell 2.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-17 01:25:23 +02:00
.github/workflows JEAP-7322 Adapted github build workflow 2026-07-30 11:41:32 +02:00
.mvn JEAP-6511: reaction observer service oss 2026-07-21 14:50:37 +02:00
.run JEAP-6511: reaction observer service oss 2026-07-21 14:50:37 +02:00
docker fix(deps): update all dependencies 2026-08-14 23:04:22 +00:00
jme-reaction-observer-service fix(deps): update all dependencies to v8 2026-08-16 23:04:19 +00:00
jme-reaction-observer-test fix(deps): update all dependencies to v8 2026-08-16 23:04:19 +00:00
.gitignore JEAP-6511: reaction observer service oss 2026-07-21 14:50:37 +02:00
.trivyignore JEAP-6511: reaction observer service oss 2026-07-21 14:50:37 +02:00
CHANGELOG.md fix(deps): update all dependencies to v8 2026-08-16 23:04:19 +00:00
CONTRIBUTING.md JEAP-6511: reaction observer service oss 2026-07-21 14:50:37 +02:00
exclude-patterns.txt JEAP-6511: reaction observer service oss 2026-07-21 14:50:37 +02:00
LICENSE JEAP-6511: reaction observer service oss 2026-07-21 14:50:37 +02:00
mvnw JEAP-6511: reaction observer service oss 2026-07-21 14:50:37 +02:00
mvnw.cmd JEAP-6511: reaction observer service oss 2026-07-21 14:50:37 +02:00
pom.xml fix(deps): update all dependencies to v8 2026-08-16 23:04:19 +00:00
publiccode.yml Update version/date in publiccode.yml 2026-08-17 01:25:23 +02:00
README.md JEAP-6511: reaction observer service oss 2026-07-21 14:50:37 +02:00
SECURITY.md JEAP-6511: reaction observer service oss 2026-07-21 14:50:37 +02:00
setPomVersions.sh JEAP-6511: reaction observer service oss 2026-07-21 14:50:37 +02:00
THIRD-PARTY-LICENSES.md Updating THIRD-PARTY-LICENSES.md 2026-08-14 10:15:37 +02:00

JME Reaction Observer Service

This example shows how to set up and run an instance of the jEAP Reaction Observer Service locally.

The jEAP Reaction Observer Library runs inside each microservice of a business application and publishes events describing how the service reacted to an incoming message (which messages it produced in response to a consumed message). This Reaction Observer Service instance consumes those events, aggregates them into a queryable model, and exposes them through a REST API so that other jEAP components (for example the Architecture Repository) can render the observed system behaviour.

It contains the following modules:

  • jme-reaction-observer-service: An instance of the Reaction Observer Service, built on top of jeap-reaction-observer-service-instance.
  • jme-reaction-observer-test: End-to-end integration tests that verify the service against real infrastructure.

Changes

This project is versioned using Semantic Versioning and all changes are documented in CHANGELOG.md following the format defined in Keep a Changelog.

Prerequisites

To use this project, ensure you have the following installed:

  1. Java Development Kit (JDK): Version 25.
  2. Docker: For running the required infrastructure (PostgreSQL and Kafka).

Note: Use the provided Maven wrapper to build and run the project.

Getting started

Infrastructure

Before the application can be started, the infrastructure (PostgreSQL and Kafka) must be running:

docker-compose -f docker/docker-compose.yml up

If you already have a Kafka cluster running locally, for example the one started by the jme-messaging-example, you can instead start only the PostgreSQL database:

docker-compose -f docker/docker-compose-db-only.yml up

Build

The project can be built with:

./mvnw install

Start

The application can then be started using:

./mvnw --projects jme-reaction-observer-service spring-boot:run -Dspring-boot.run.profiles=local

Access

Once started, the Swagger UI is available at:

http://localhost:8080/jme-reaction-observer-service/swagger-ui/index.html

The service consumes the jme-reaction-identified and jme-reactions-observed topics, which are published by services in the JME example system that embed the jEAP Reaction Observer Library, for example the JME messaging example.

Profiles

  • application-local: Contains all configurations for running the application locally (local PostgreSQL and Kafka).

Integration Tests

The jme-reaction-observer-test module contains end-to-end integration tests that verify the service against real infrastructure: it starts the docker-compose infrastructure (PostgreSQL and Kafka), starts the packaged jme-reaction-observer-service as a real process, publishes real ReactionIdentifiedEvent / ReactionsObservedEvent messages on Kafka - exactly as the jEAP Reaction Observer Library would from another service - and verifies the data through the service's own, HTTP-Basic-secured REST API.

Running locally

# Build and install all local modules
./mvnw install -pl '!:jme-reaction-observer-test'
# Run integration tests
./mvnw verify -pl jme-reaction-observer-test

This will:

  1. Start the Docker Compose infrastructure (PostgreSQL and Kafka are stopped after the test).
  2. Build and start jme-reaction-observer-service as a Maven subprocess on port 8080.
  3. Publish reaction-observer events onto the real Kafka broker and verify them through the REST API.
  4. Stop all services and containers.

Ensure Docker is running and ports 5433, 7781, 8080 and 9092 are available.

Running on CI

On CI the CI environment variable must be set. This activates the ci Spring profile, which uses docker-compose-ci.yml as an overlay (removing host port bindings, using the container hostnames, and switching to the broker's internal, unauthenticated listener). On CI an isolated Docker network is used to allow for parallel builds.

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.