Skip to content
CAI
Software that uses CAICheck a score

michalzeman/spring-reactive-microservices

55.8

Adequate · 21 September 2026

3.7k

lines of production code

Java

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This release establishes the foundational architecture for a reactive, event-sourced microservices system, introducing the API Gateway, Shortener, Statistic, and User services. It implements a CQRS and event sourcing pattern using Akka and Kafka, with MongoDB for persistence and reactive streams for domain event propagation. The update includes comprehensive DTOs, domain models, and Kafka topic definitions that enable asynchronous communication between services. Additionally, the release provides full test coverage for the new modules and initializes the Maven build infrastructure.

Features

Add Docker Compose configuration for microservices and Kafka infrastructure

Added Docker Compose files to containerize the application's microservices (api-gateway, shortener-service, statistic-service, user-service) along with their dependencies (Kafka, Zookeeper, Schema Registry, KSQL, Mongo). The setup includes a script to create necessary Kafka topics and a main compose file that orchestrates the entire stack, enabling local development and testing of the event-sourced architecture.

docker · high confidence

Added Kafka message processor for shortener events

A new ShortenerProcessor service was added to handle publishing shortener-related domain events to Kafka topics. This processor subscribes to the application's internal message bus, filters for ShortenerViewed, ShortenerChangedEvent, and document events, and sends them to respective Kafka topics using the Reactor Kafka sender. This enables external consumers to subscribe to these events via Kafka.

shortener-impl/src/main/java/com/mz/reactivedemo/shortener/port · medium confidence

Added project scaffolding and build infrastructure

The repository now includes the standard Maven wrapper scripts (mvnw, mvnw.cmd) and a .gitignore file to support local development and CI/CD workflows. Additionally, the README.md has been expanded to provide comprehensive documentation, including a license header, an overview of the microservices architecture (Api-gateway, Statistic MS, Shortener MS, User MS), and detailed instructions for building and running the services locally using Docker and curl.

(repo-wide) · high confidence

Added shortener view layer for read operations

A new view layer was introduced in the shortener module to handle read operations. This includes a MongoDB document model (ShortenerDocument) and a query interface (ShortenerQuery) with implementations that retrieve shortener data and map keys to URLs, supporting the application's CQRS architecture.

shortener-impl/src/main/java/com/mz/reactivedemo/shortener/view · high confidence

Adds common utility and domain modeling classes

The common module introduces new foundational classes to support the application's architecture. This includes a \CommandResult\ type to handle command execution outcomes and domain events, an \Aggregate\ interface with an abstract base class for implementing the CQRS pattern, and a \Try\ monad for handling success/failure states. Additionally, the update provides a \KafkaMapper\ for serializing domain events to Kafka records, an \HttpHandler\ interface for Spring WebFlux routing, and utility classes for logging and pattern matching.

common/src/main · high confidence

Initial implementation of the shortener microservice

The shortener-impl module is introduced, providing the core functionality for URL shortening. This includes the Spring Boot application entry point, a configuration class that wires up Kafka producers and consumers for event sourcing and user change notifications, and a reactive HTTP handler that exposes REST endpoints for creating, updating, and retrieving shorteners. The implementation utilizes Spring WebFlux for reactive routing and integrates with Kafka Streams to maintain a read-only user document store, enabling the service to react to user-related events.

shortener-impl/src/main/java/com/mz/reactivedemo/shortener · high confidence

Initial release of the API Gateway service

The api-gateway module is introduced, providing a Spring Boot application that routes requests to the statistic, shortener, and user services. The gateway is configured with routes for /statistics/\\, /shorteners/\\, and /users/\\, with service endpoints defined in application.yml and the Dockerfile. The entry includes the standard Maven wrapper scripts and a basic Spring Boot test.

api-gateway, statistic-impl/src/main/java/com/mz/statistic · high confidence

Introduce ShortenerDto for URL shortening data

A new data transfer object, ShortenerDto, has been added to the shortener-api module. This class, generated via Immutables, encapsulates the core attributes of a shortened URL, including the unique identifier, associated user ID, original URL, generated short URL, creation timestamp, and version number. This DTO serves as the structured representation for shortener entities within the API layer.

shortener-api/src/main/java/com/mz/reactivedemo/shortener/api/dto · high confidence

Introduce reactive message bus for event and document streaming

A new reactive message bus interface and its Spring service implementation have been added to the shortener module. The \ApplicationMessageBus\ interface and \ApplicationMessageBusImpl\ class provide methods to publish events and \ShortenerDto\ objects, and expose reactive streams (\Flux\) for consuming these items. This change supports the underlying CQRS and event sourcing architecture by decoupling event and document publishing from their consumers via reactive streams.

shortener-impl/src/main/java/com/mz/reactivedemo/shortener/streams · high confidence

Introduce shortener domain model and aggregate

The shortener domain now includes the core domain classes: ShortUrl, Url, and ShortenerAggregate, along with domain events (ShortenerCreated, ShortenerUpdated, ShortenerChanged). This establishes the internal state management and event sourcing structure for the shortener feature.

shortener-impl/src/main/java/com/mz/reactivedemo/shortener/domain · high confidence

Introduce user domain events and commands for user and contact info management

Added new message types to support user and contact information workflows. The system now includes commands for creating users and contact details (CreateUser, CreateContactInfo) and corresponding domain events (UserChangedEvent, UserEventType) to track user lifecycle changes. Payloads for user and contact info (UserPayload, ContactInfoPayload) are introduced to structure the data. This change enables the underlying infrastructure to process these new message types for user-related operations.

user-api/src/main/java/com/mz/user/message · high confidence

Introduced Kafka topic definitions for the shortener feature

Added the ShortenerTopics interface, which defines the Kafka topic names used by the shortener service (shortener-viewed, shortener-document, shortener-changed). This establishes the contract for event-driven communication within the shortener module.

.mvn, shortener-api/src/main/java/com/mz/reactivedemo/shortener/api/topics · high confidence

Introduces common event and command interfaces

The common-api module now includes new interfaces for the application's event sourcing and command patterns. Specifically, it adds the base Event interface with automatic UUID generation and timestamps, a DomainEvent interface that enforces an aggregateId, and empty marker interfaces for Command and Document. These abstractions provide a standardized contract for domain events and commands across the system.

common-api · high confidence

New persistence layer with Akka-based aggregate repository and read-only document store

The common-persistence module now introduces a new persistence architecture built on Akka actors. This includes an AggregateRepository that routes commands to specific aggregate actors, with a RecoveryActor to handle actor lifecycle and state recovery. The system also adds an AggregateService to coordinate command execution, view updates, and event publishing, alongside an AggregateFactory for creating aggregate instances. Additionally, a new DocumentReadOnlyRepository interface and its Kafka Streams-based implementation provide a read-only view of document data, enabling efficient read access to Kafka topics as global storage.

common-persistence · high confidence

New user and contact information DTOs

Added three new DTO interfaces in the user-api module: BasicDto, ContactInfoDto, and UserDto. These define the structure for user data, including fields for first/last name, a list of shortener IDs, and optional contact information (email and phone number).

user-api/src/main/java/com/mz/user/dto · high confidence

Statistic service now tracks shortener and user events

The StatisticServiceImpl has been implemented to subscribe to and process events from the shortener and user domains. It listens for shortener view and change events, as well as user creation and update events, storing each in the statistics repository. The service also exposes methods to retrieve all stored statistics and count events by type.

statistic-impl/src/main/java/com/mz/statistic/impl · high confidence

User service implementation with event sourcing and reactive web layer

The user-impl module now contains the full implementation of the user microservice, introducing a reactive web API for creating users and contact information, alongside an event-sourced domain model that persists state changes to MongoDB and publishes domain events to Kafka topics. The service exposes REST endpoints for user creation, contact info updates, and queries, while internal components handle message bus integration, Kafka producer/consumer wiring, and view-model mapping.

user-impl/src · high confidence

Behavioural changes

Added UserTopics interface for Kafka topic constants

A new Java interface, UserTopics, was added to define Kafka topic constants for user-related events. This includes the 'user-changed' topic, which is used for publishing UserChangedEvent messages, as well as a 'user-document' topic. This change provides a centralized location for these topic names, supporting the existing Kafka integration for user events.

user-api/src/main/java/com/mz/user/topics · medium confidence

Configured MongoDB persistence and Kafka bindings for the shortener service

The shortener-impl service now includes configuration files to support Akka persistence with MongoDB as the journal and snapshot store, enabling event sourcing capabilities. Additionally, the service is configured with Kafka stream bindings for the 'user-document' destination and reactive Kafka consumer groups, facilitating integration with the Kafka-based event sourcing and document reading infrastructure.

shortener-impl/src/main/resources · medium confidence

Introduce shortener domain events and commands for CQRS and event sourcing

Added new command and event classes to support a CQRS and event-sourcing architecture for the shortener feature. The update introduces \CreateShortener\ and \UpdateShortener\ commands, alongside a hierarchy of domain events including \ShortenerEvent\, \ShortenerChangedEvent\, \ShortenerPayload\, \ShortenerEventType\, and \ShortenerViewed\. These classes define the structure for tracking shortener state changes and view counts, enabling the system to persist and process these events for downstream subscribers.

shortener-api/src/main/java/com/mz/reactivedemo/shortener/api/event · high confidence

Shortener service now enforces user existence and publishes domain events via reactive streams

The shortener implementation has been refactored to use a reactive, event-sourcing approach. The application service now validates that a user exists before creating a shortener, and domain changes are published as events via an application message bus. This enables asynchronous processing and ensures that state changes are propagated through the system's event stream.

shortener-impl/src/main/java/com/mz/reactivedemo/shortener/impl · medium confidence

Test coverage

Added integration and unit tests for the shortener module; Added integration tests for the Statistic service; Added unit tests for ShortenerAggregate; Added unit tests for StatisticServiceImpl; Added unit tests for common utility classes; Added unit tests for shortener service and query implementations.

Dependencies

Initial Maven dependency configuration for the microservices architecture

The project's build system is initialized with Maven POM files for all modules, including the root, api-gateway, common, common-api, common-persistence, shortener-api, shortener-impl, statistic-impl, user-api, and user-impl. These files establish the project's dependency management, incorporating Spring Boot 2.2.5, Spring Cloud Hoxton.RELEASE, Akka 2.5.21, Jackson 2.12.7.1, and various testing libraries like JUnit 5 and Mockito.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 55 → 56 (+0.8)
  • Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 99 (-0.4)
  • Architecture 100 → 87 (-12.7)
  • Maturity 68 → 68 (+0.0)
  • Readiness 29 → 32 (+2.7)
  • Security 96 → 91 (-4.4)
  • Domain Modelling 74 → 79 (+4.3)

Resolved (8)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • Duplicated block (7 lines × 2) (shortener-impl/src/main/java/com/mz/reactivedemo/shortener/ShortenerConfiguration.java)
  • Duplicated block (7 lines × 6) (shortener-impl/src/main/java/com/mz/reactivedemo/shortener/ShortenerConfiguration.java)
  • No exposed public API
  • Scanner failed to run — not a clean result
  • Test reliability not included
  • dormant codebase — no living knowledge left to concentrate

New (38)

  • Dependency hygiene PARTLY measured — Maven/Gradle declarations read, no dependency graph resolved
  • Documentation: no usage examples (README.md)
  • Duplicated block (5 lines × 2) (shortener-impl/src/main/java/com/mz/reactivedemo/shortener/port/kafka/ShortenerProcessor.java)
  • Duplicated block (6 lines × 2) (shortener-impl/src/main/java/com/mz/reactivedemo/shortener/ShortenerConfiguration.java)
  • Duplicated block (6 lines × 2) (shortener-impl/src/main/java/com/mz/reactivedemo/shortener/ShortenerConfiguration.java)
  • Duplicated block (6 lines × 2) (shortener-impl/src/main/java/com/mz/reactivedemo/shortener/ShortenerConfiguration.java)
  • Duplicated block (6 lines × 6) (shortener-impl/src/main/java/com/mz/reactivedemo/shortener/ShortenerConfiguration.java)
  • Duplicated block (7 lines × 2) (shortener-impl/src/main/java/com/mz/reactivedemo/shortener/ShortenerConfiguration.java)
  • Duplicated block (7 lines × 2) (statistic-impl/src/main/java/com/mz/statistic/StatisticConfiguration.java)
  • Low IaC: DS-0026 (api-gateway/Dockerfile)
  • Low IaC: DS-0026 (shortener-impl/Dockerfile)
  • Low IaC: DS-0026 (statistic-impl/Dockerfile)
  • Low IaC: DS-0026 (user-impl/Dockerfile)
  • Medium IaC: WD-COMPOSE-0002 (docker/docker-compose.yml)
  • Medium IaC: WD-COMPOSE-0002 (docker/docker-compose.yml)
  • Medium IaC: WD-COMPOSE-0002 (docker/docker-compose.yml)
  • Medium IaC: WD-COMPOSE-0002 (docker/docker-compose.yml)
  • Medium IaC: WD-COMPOSE-0002 (docker/docker-compose.yml)
  • Medium IaC: WD-COMPOSE-0002 (docker/docker-compose.yml)
  • Medium IaC: WD-COMPOSE-0002 (docker/docker-compose.yml)
  • …and 18 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

michalzeman/spring-reactive-microservices was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 3cefbfe631b295b010a881ae8e2a4a045fc08067 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.