johanhaleby/occurrent
63.0
Adequate · 4 August 2026
50.5k
lines of production code
Java
with Kotlin
3
measurements over time
What this system is
This system is an event sourcing framework that manages domain state through immutable events, supporting both traditional stream-based and Dynamic Consistency Boundary (DCB) architectures. It provides comprehensive tooling for command composition, query filtering, and materialized view construction across both blocking and reactive execution models. The codebase includes robust persistence integrations for MongoDB and Redis, alongside a rich set of examples demonstrating various domain patterns.
How it got here
2020 — DCB support and MongoDB integration
70 changes.
This period focused on introducing Dynamic Consistency Boundary (DCB) support and expanding the MongoDB integration with native, Spring, and Reactor implementations. The team also modernized the codebase by upgrading to Java 21, adopting Jakarta EE, and adding comprehensive test coverage for the new subscription and event store APIs.
2021–2024 — Kotlin DSL and CloudEvent integration
45 changes.
This period focused on expanding Kotlin support through new DSLs for deciders, views, and queries, alongside comprehensive CloudEvent conversion and type mapping features. The team also introduced deadline scheduling, refined MongoDB subscription models, and added extensive test coverage across the new modules.
2026 — Dynamic Consistency Boundary (DCB) implementation
62 changes.
This period focused on introducing the Dynamic Consistency Boundary (DCB) pattern across the codebase, including new APIs, application services, and DSLs for both blocking and reactive stacks. The work also expanded the example applications to demonstrate DCB capabilities and added comprehensive test coverage for the new features.
Features
Add Dynamic Consistency Boundary (DCB) example for the word-guessing game
The word-guessing game now includes a new example implementation using the Dynamic Consistency Boundary (DCB) pattern with Spring and MongoDB. This adds a complete bootstrap configuration, a subscription handler to send emails to game winners, and a test suite verifying the DCB infrastructure and event conversion. The example demonstrates how to configure the event store, subscription model, and application service for this consistency model.
example/domain/word-guessing-game/mongodb/spring/dcb · high confidence
Add Dynamic Consistency Boundary support for the word-guessing game
Added new files to the Spring Boot auto-configuration and feature modules that implement the Dynamic Consistency Boundary (DCB) for the word-guessing game. This includes query factories (GameDcbQueries) that construct DcbCriteria for game events, gameplay, word hints, and points, as well as a GameEventTagGenerator that assigns specific tags (game, gameplay, wordHint, points) to game events. This enables consistent querying and filtering of events by game ID and event type within the MongoDB event store.
example/domain/word-guessing-game/mongodb/spring/dcb-autoconfig/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/autoconfig/features/dcb, example/domain/word-guessing-game/mongodb/spring/dcb/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/features/dcb, example/domain/word-guessing-game/mongodb/spring/dcb-autoconfig/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/autoconfig/features/gameplay, example/domain/word-guessing-game/mongodb/spring/dcb/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/features/gameplay · high confidence
Add Kotlin DSL extensions for blocking DCB execution, querying, and subscriptions
New Kotlin extension functions are introduced for the blocking stack, providing idiomatic access to Dynamic Consistency Boundary (DCB) capabilities. DcbApplicationService now includes execute and executeAndReturn\* methods that accept a DcbDecider, automatically resolving the read boundary and applying decider-specific tags. DcbDomainEventQueries gain queryForList and queryForSequence variants that return Kotlin collections and sequences, along with tag-based query shortcuts. DcbSubscriptions provide a simplified subscribeDcb entry point with Kotlin-friendly defaults. These additions streamline working with DCB in Kotlin without requiring Java-style builder patterns.
dsl/dcb-dsl/blocking/src/main/kotlin · high confidence
Add MongoDB filter-to-query conversion for Spring Data
The module now provides internal converters that translate OCurrent Filter and Condition objects into Spring Data MongoDB Query and Criteria objects. This enables filtering event streams and DCB-tagged events in MongoDB by converting single-operand conditions (e.g., equality, comparison operators) and multi-operand conditions (AND, OR, NOT) into MongoDB criteria. The implementation also handles capability-based filtering to distinguish between stream and DCB events using the dcbTags field, ensuring that DCB-tagged events are excluded from stream catch-up subscriptions.
common/mongodb/spring/filter-query-conversion · high confidence
Add Occurrent-based Hederlig module initializer
Introduces the Occurrent integration for the Hederlig library, providing an \OccurrentHederligModuleInitializer\ that wires up domain event subscriptions and query handling using the Occurrent framework. This enables users to leverage Occurrent's event sourcing and query capabilities within the Hederlig module initialization process.
library/hederlig/src/main/kotlin/org/occurrent/library/hederlig/initialization · high confidence
Add RFC3339 date/time formatting and parsing support
The \common/time\ module now includes a new \RFC3339\ utility class that provides a \DateTimeFormatter\ for parsing and formatting date-time strings in the RFC 3339 format, supporting optional timezone offsets and fractional seconds. This is accompanied by a corresponding test suite (\RFC3339Test\) that validates the conversion of various RFC 3339 date-time strings to \OffsetDateTime\ objects.
common/time · high confidence
Add Spring-based UNO example with MongoDB and Redis subscriptions
A new Spring Boot example for the UNO domain model is introduced, demonstrating a blocking application service backed by a MongoDB event store and Redis for checkpoint storage. The example configures durable subscriptions to track game progress and includes a demo component that runs a sample UNO game on startup, utilizing Spring's retry mechanisms for Redis operations.
example/domain/uno/mongodb/spring/blocking/src/main · high confidence
Add annotation-driven DCB TagGenerator and nullness defaults
The dcb-annotation module now includes an optional, annotation-driven DCB TagGenerator that derives tags from @DcbTag-annotated event components. The @DcbTag annotation now accepts the tag key as value() with key() as an alias, and the system supports custom annotations via the AnnotationTagGenerator. Additionally, JSpecify nullness defaults are applied across the Java packages, and the event store writes use List instead of Stream.
application/service/dcb-annotation · medium confidence
Add event-sourced Uno example using MongoDB
A new event-sourced implementation of the Uno example has been added, providing a runnable application that uses a MongoDB-backed event store and a native MongoDB subscription model. The example demonstrates partial application support for commands and includes a progress tracker that listens to domain events, configured with a logback logging setup.
example/domain/uno/mongodb/native · high confidence
Add functional stream utilities and nullness annotations
The common/functional-support module now provides new utility methods for Java streams, including auto-closing streams, mapping with index, and zipping two streams, alongside a Pair class for handling dual values. Additionally, the internal package is annotated with JSpecify's @NullMarked to enforce nullness defaults across the package.
common/functional-support · high confidence
Add in-memory deadline registry implementation
The in-memory module now includes an internal data structure, DeadlineData, and a corresponding test suite, InMemoryDeadlineTest, which validates the scheduling and consumption of typed deadlines. The package is annotated with @NullMarked from JSpecify to enforce null-safety conventions across the in-memory deadline implementation.
deadline/inmemory · high confidence
Add in-memory subscription model for local event processing
Introduces a new in-memory subscription model that allows applications to process CloudEvents locally using an in-memory queue. This provides a lightweight, non-persistent way to handle events without external dependencies, supporting standard subscription filters and retry strategies.
subscription/inmemory/src/main · high confidence
Add native blocking MongoDB checkpoint storage implementation
Introduced a new blocking implementation of the CheckpointStorage interface for MongoDB, allowing subscription positions to be persisted using the native Java MongoDB driver. The change includes the main storage class, package-level null-safety annotations, and comprehensive tests verifying checkpoint read/write operations and legacy field migration.
subscription/mongodb/native/blocking-position-storage · high confidence
Add number-guessing-game example using MongoDB native driver
A new example application demonstrating a number-guessing game implemented with the MongoDB native driver is now available. The example includes a web API built with Javalin that allows users to start new games, submit guesses, and view game status and history. The application service handles domain logic by reading and writing events to the event store, and the web layer renders HTML responses for game interactions.
example/domain/number-guessing-game/mongodb/native/src/main/java/org/occurrent/example/domain/numberguessinggame/mongodb/nativedriver · high confidence
Add reactive Spring Boot starter for subscription DSL
Introduced a new reactive subscription DSL for Spring Boot, providing a \Subscriptions\ entry point that delivers both stream-written and DCB-appended events. The \Subscriptions\ class automatically derives a stable default subscription ID from the CloudEvent type and exposes a \waitUntilStarted\ method on the returned \Subscription\ for reactive composition, differing from the blocking DSL which blocks the calling thread.
dsl/subscription-dsl/reactor · high confidence
Add reactive Spring MongoDB event store support for DCB
A new reactive interface, DcbEventStore, is introduced in the dcb-reactor module, providing non-blocking (Mono-based) operations for Dynamic Consistency Boundary reads and appends. This allows applications to perform DCB queries and event appends using the Reactor framework, complementing the existing blocking API.
eventstore/api/dcb-reactor · high confidence
Add reactive domain command boundary implementations for guest and room management
The hotel-booking example now includes reactive implementations for managing guests and rooms. New files introduce domain-specific tags for guests and rooms, and expose use-case functions (register/deregister guest, define/close room) that execute commands via the reactive DCB (Domain Command Boundary) framework, enabling asynchronous, event-driven interactions with the domain model.
example/domain/hotel-booking/src/main/kotlin/org/occurrent/example/domain/hotelbooking/features/guestmanagement, example/domain/hotel-booking/src/main/kotlin/org/occurrent/example/domain/hotelbooking/features/roommanagement · medium confidence
Add reactive hotel booking and cancellation use cases
Introduced the Booking use-case file that exposes reactive functions for booking and cancelling a room. These functions leverage the DCB (Domain Command Boundary) pattern, executing the corresponding commands (BookRoom, CancelBooking) via a shared bookingDcbDecider, enabling asynchronous, non-blocking interactions with the hotel booking domain.
example/domain/hotel-booking/src/main/kotlin/org/occurrent/example/domain/hotelbooking/features/booking · high confidence
Add reactive hotel-booking example with DCB support
A new reactive example application for hotel booking has been added to the codebase. This includes the Spring Boot bootstrap configuration, domain command and event interfaces, type aliases, a read-model subscriber that processes domain events via the DCB (Distributed Command Bus) subscription mechanism, a web controller for the dashboard, and the associated CSS styles. The example demonstrates the use of reactive patterns and DCB capabilities within the hotel booking domain.
example/domain/hotel-booking · high confidence
Add reactive query DSL for domain events
The \dsl/query-dsl/reactor\ module now provides a reactive query DSL for domain events, exposing Kotlin extension functions such as \query\, \queryOne\, and \queryForList\ that return \Flux\ or \Mono\ types. This enables users to perform reactive domain event queries with support for filtering, sorting, and pagination. The implementation includes corresponding unit tests in both Java and Kotlin to verify the new query capabilities.
dsl/query-dsl/reactor · high confidence
Add reflection-based CloudEvent type mapping
The reflection module now provides a new ReflectionCloudEventTypeMapper that maps domain events to CloudEvent types using either the simple or fully qualified class name. This implementation supports flexible configuration via the ClassName abstraction, allowing users to choose between simple name mapping (with optional package prefix or custom mapping functions) or fully qualified name mapping. Tests confirm that the mapper correctly resolves domain event classes from CloudEvent type strings in both modes.
application/cloudevent-type-mapper/reflection · high confidence
Add server-rendered course dashboard with HTMX polling
A new server-rendered web page is introduced for the course enrollment example, featuring a dashboard that displays course and student information. The implementation includes a Spring MVC controller that serves the main page and a separate endpoint for the dashboard table, which is designed to be polled by HTMX to allow eventually-consistent counters to refresh automatically.
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/coursedashboard · medium confidence
Add server-rendered web page for course enrollment
A new EnrollmentController is introduced to provide a server-rendered web interface for managing course enrollments. Users can now view course details, enroll and unenroll students via HTTP POST requests, and view a live activity feed of enrollment changes via Server-Sent Events (SSE). The controller integrates with the existing domain services to handle enrollment actions and display student names in the activity feed.
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/enrollment/web · medium confidence
Add server-rendered web pages for course enrollment
Added new Thymeleaf templates that render the course enrollment dashboard, course detail, and feedback fragments. The dashboard displays tables of courses and students with options to cancel courses and deregister students. The course detail page allows enrolling and unenrolling students, while the index page provides forms to define courses and register students. All pages use Pico.css for styling and htmx for dynamic updates.
example/domain/course-enrollment/src/main/resources/templates · high confidence
Add web controllers for course and student management
The example application now includes server-rendered web pages for managing courses and students. The new CourseManagementController exposes endpoints to define, cancel, and manage courses, while the StudentManagementController provides endpoints to register and deregister students. These controllers handle HTTP POST requests for course and student operations, providing immediate feedback to users about the success or failure of these actions.
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/coursemanagement/web, example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/studentmanagement/web · high confidence
Added Arrow-based Decider DSL implementation
Introduced a new decider implementation in the 'arrow' subpackage that leverages the Arrow library's \Either\ type for handling command decisions and state evolution. This change adds the core \Decider\ interface and a \decider\ factory function, along with a corresponding test class (\MyDeciderTest\) that validates the behavior of the new DSL.
deadline/jobrunr/src/main, dsl/decider-arrow · high confidence
Added CloudEventConverter interface and Kotlin extensions
Introduced the CloudEventConverter interface in the application/cloudevent-converter/api module, providing methods to convert domain events to and from CloudEvents, including a new getCloudEventType method and batch conversion defaults. Added Kotlin extension functions that provide operator overloading for the converter, allowing idiomatic access to cloud event type mapping and event conversion in Kotlin code.
application/cloudevent-converter/api · high confidence
Added DCB-based event handlers for point awarding and word hints
New event handlers have been introduced for the word-guessing-game example, implementing the Dynamic Consistency Boundary (DCB) pattern. The \AwardPointsToPlayerThatGuessedTheRightWord\ component now processes \PlayerGuessedTheRightWord\ events to award points based on game state, while \RevealInitialCharactersInWordHintAfterGameIsStarted\ handles \GameWasStarted\ events to reveal initial characters in word hints. Both components utilize \DcbApplicationService\ and \EventMetadata\ to ensure consistent, ordered processing of domain events.
example/domain/word-guessing-game/mongodb/spring/dcb-autoconfig/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/autoconfig/features/pointawarding, example/domain/word-guessing-game/mongodb/spring/dcb-autoconfig/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/autoconfig/features/wordhint · high confidence
Added Delay model to support time-based delays
A new 'Delay' sealed interface and its implementations (RelativeDelay and DelayUtil) have been added to the hederlig library's model package. This introduces a structured way to represent delays, either as a relative duration or a specific point in time, providing a foundation for time-based delay logic within the DSL.
library/hederlig/src/main/kotlin/org/occurrent/library/hederlig/model · high confidence
Added FindGameByIdQuery for retrieving game state
A new FindGameByIdQuery component has been introduced in the word guessing game example. This component uses DomainEventQueries to retrieve all game events for a specific game ID and assembles them into a GameReadModel, enabling the application to query the current state of a game by its identifier.
example/domain/word-guessing-game/mongodb/spring/blocking/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/blocking/features/gameplay/views/game · high confidence
Added ListCommandComposition for composing list-based commands
A new ListCommandComposition utility has been introduced to allow users to compose multiple list-based domain functions into a single function that executes them in left-to-right order. This change, alongside the addition of @NullMarked to the package-info, supports the broader refactoring that replaces the previous PartialListCommandApplication and PartialStreamCommandApplication classes with a generic PartialFunctionApplication, simplifying the API for composing commands.
application/command-composition/src/main/java/org/occurrent/application/composition/command · medium confidence
Added MongoDB-backed views for ended and ongoing games
The word guessing game example now includes new read-model views for tracking game history. A capped MongoDB collection is initialized at startup, and domain events (GameWasWon, GameWasLost, GameWasStarted) are subscribed to via the new Subscriptions DSL, which updates the 'ended games' and 'ongoing games' collections. Queries are provided to retrieve the latest N games from each view.
example/domain/word-guessing-game/mongodb/spring/blocking/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/blocking/features/gameplay/views/endedgamesoverview · high confidence
Added RPS example web application with Spring Boot and MongoDB
A new example web application for the Rock-Paper-Scissors domain has been added, providing a Spring Boot-based entry point (Bootstrap) and a REST controller (GamePlayController) that exposes endpoints for initializing and playing games. The application is configured to use MongoDB for persistence, with the test setup utilizing Testcontainers to spin up a MongoDB instance for integration testing.
example/domain/rps/decider-web · high confidence
Added Spring Boot example for the word guessing game using MongoDB and blocking subscriptions
A new Spring Boot application for the word guessing game example has been introduced in the MongoDB blocking module. This includes the main Bootstrap configuration wiring up the event store, durable and catchup subscription models, and domain event queries. The example also adds utility extensions for list handling and logging, providing a complete, runnable reference for implementing event-sourced applications with Spring and MongoDB.
example/domain/word-guessing-game/mongodb/spring/blocking · high confidence
Added Spring MongoDB blocking subscription implementation
Introduced the SpringMongoSubscription class and package-level null-marking to provide a blocking subscription model for MongoDB within the Spring framework. This new implementation enables users to interact with MongoDB subscriptions using a synchronous, blocking API, supported by JSpecify annotations for null-safety.
subscription/mongodb/spring/blocking/src/main · medium confidence
Added Spring-based Redis checkpoint storage for blocking subscriptions
The library now provides a Spring-integrated implementation for storing subscription checkpoints in Redis. The new \SpringRedisCheckpointStorage\ class implements \CheckpointStorage\ to persist subscription positions, enabling durable, blocking subscriptions that can resume from the last known position after restarts. This includes the core storage implementation, package-level nullness annotations, and associated test infrastructure to verify checkpoint read/write/delete operations.
subscription/redis/spring/blocking-position-storage · high confidence
Added course management use cases for defining and canceling courses
Users can now define new courses and cancel existing ones through the course management feature. The new \CourseManagement\ file introduces \defineCourse\ and \cancelCourse\ functions, allowing users to create courses with a title and capacity, as well as cancel courses by ID.
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/coursemanagement/usecases · high confidence
Added email winner feature to the word guessing game
A new 'email winner' feature has been added to the word guessing game. This change introduces a Spring configuration class that subscribes to the 'GameWasWon' event. When a game is won, the system logs a message indicating that an email would be sent to the winner, serving as the foundation for future email notification logic.
example/domain/word-guessing-game/mongodb/spring/blocking/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/blocking/features/emailwinner · high confidence
Added enrollment use-case functions for student enrollment and unenrollment
The course enrollment feature now exposes explicit use-case functions (enrollStudent and unenrollStudent) that execute commands via the domain command bus using the new enrollmentDcbDecider. This provides a clearer, more direct API for students to join or leave courses.
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/enrollment/usecases · high confidence
Added gameplay use cases for the word guessing game
New application service use cases, MakeGuess and StartGame, have been added to the word guessing game example. These components handle the core gameplay logic, including retry policies for event store writes and side effects for revealing word hints and awarding points.
example/domain/word-guessing-game/mongodb/spring/blocking/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/blocking/features/gameplay/usecases · high confidence
Added point-awarding and word-hint features via Dynamic Consistency Boundaries
The application now includes two new domain capabilities implemented as Dynamic Consistency Boundaries (DCB) for the word-guessing game. First, the system can now award points to a player upon guessing the correct word, calculating the total number of guesses to determine the score. Second, the system now reveals initial characters in the word hint once the game has started. Both features are implemented as Spring configuration classes that subscribe to specific game events (PlayerGuessedTheRightWord and GameWasStarted) and execute domain logic via the DcbApplicationService.
example/domain/word-guessing-game/mongodb/spring/dcb/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/features/pointawarding, example/domain/word-guessing-game/mongodb/spring/dcb/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/features/wordhint · high confidence
Added point-awarding logic for correct word guesses
A new component, AwardPointsToPlayerThatGuessedTheRightWord, has been introduced to handle the business logic for awarding points when a player correctly guesses a word. This component queries for the game start event to determine the number of previous wrong guesses and uses the application service to execute the point-awarding command. The implementation includes a retry mechanism with a backoff strategy to handle potential transient failures during the query and command execution.
example/domain/word-guessing-game/mongodb/spring/blocking/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/blocking/features/pointawarding · high confidence
Added pragmatic Rock, Paper, Scissors domain model and integration tests
A new pragmatic implementation of the Rock, Paper, Scissors domain model has been added to the example suite. This includes the core domain model in \Model.kt\ (defining value types like \PlayerId\, \GameId\, and \Timestamp\, along with domain exceptions) and comprehensive integration tests in \GamePlayTest.kt\ that verify game lifecycle states, player joining, and hand-playing logic. Additionally, an \ApplicationServiceDemo.kt\ file demonstrates how to use the Occurrent application service to compose commands and convert domain events into CloudEvents for storage.
example/domain/rps/pragmatic-model · high confidence
Added student registration and deregistration use cases
The course enrollment example now includes explicit use-case functions for registering and deregistering students. The new StudentManagement.kt file exposes registerStudent and deregisterStudent functions that execute the corresponding commands (RegisterStudent, DeregisterStudent) via the studentDcbDecider, enabling users to manage student enrollments through the domain command bus.
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/studentmanagement/usecases · high confidence
Added support for configuring MongoDB time field representation
Introduced a new \TimeRepresentation\ enum that allows users to choose how the CloudEvent 'time' field is persisted in MongoDB. Users can now select between storing the time as an RFC 3339 string or as a MongoDB Date object, each with distinct implications for precision and query capabilities.
common/mongodb/specialfilterhandling · high confidence
Added transactional projection example using Spring, Reactor, and MongoDB
Added a new example demonstrating transactional projections with Spring WebFlux, Project Reactor, and MongoDB. The example includes a \CurrentName\ entity, a \CurrentNameProjection\ repository, a \NameApplicationService\ that handles name definition and changes while updating the projection, and the main Spring Boot application configuration wiring the reactive MongoDB transaction manager and event store.
example/projection/spring-reactor-transactional-projection-mongodb/src/main · high confidence
Added view models and handlers for the number guessing game
The update introduces new Java classes that implement the view layer for the number guessing game. This includes the \NumberGuessingGameCompleted\ integration event, which captures game results, and the \GameStatus\ model along with the \WhatIsTheStatusOfGame\ interface, which track the current state of active games. Additionally, the \LatestGamesOverview\ interface and \InsertGameIntoLatestGamesOverview\ handler are added to manage and update the collection of recent games. All new files include Apache 2.0 license headers and JSpecify nullness annotations.
example/domain/number-guessing-game/mongodb/native/src/main/java/org/occurrent/example/domain/numberguessinggame/mongodb/nativedriver/view · high confidence
Added web interface for the word guessing game
A new REST controller has been introduced to serve the word guessing game via a web interface. This controller handles displaying ongoing and ended games, starting new games, and processing player guesses, rendering the responses as HTML pages.
example/domain/word-guessing-game/mongodb/spring/blocking/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/blocking/features/gameplay/website · high confidence
Adds Kotlin extension functions for blocking event store queries
New Kotlin extension functions are now available for the blocking event store API. EventStoreQueries gains queryForSequence and queryForList methods, allowing queries to return Kotlin Sequence and List types respectively, while EventStream provides an eventSequence convenience function to convert event streams to sequences.
eventstore/api/blocking/src/main/kotlin · high confidence
Adds Kotlin extension functions for decider composition and application service integration
The \dsl/decider\ module now includes new Kotlin extension functions that simplify working with deciders in Kotlin. \ApplicationServiceDeciderExtensions.kt\ provides \execute\, \executeAndReturnDecision\, \executeAndReturnState\, and \executeAndReturnEvents\ methods on \ApplicationService\, automatically widening event types so feature deciders can run directly against broader application services. \DeciderExtensions.kt\ introduces \decider\ factory, \adapt\/\adaptEvents\ for type widening, and \compose\ functions that combine two, three, or four+ deciders into a single composite decider, supporting both infix and prefix syntax.
dsl/decider/src/main · medium confidence
Automated migration tools for upgrading to Occurrent 0.30.0
OpenRewrite recipes are now available to automate the upgrade from Occurrent 0.20.5 to 0.30.0. The \UpgradeToOccurrent\_0\_30\ umbrella recipe handles three categories of changes: it rewrites Maven and Gradle artifact coordinates to the new \occurrent-\ prefix scheme, applies mechanical renames for types, methods, and packages (such as \SubscriptionPosition\ to \Checkpoint\), and performs a best-effort migration of the write side from \Stream\ to \List\. The migration tool safely rewrites literal \Stream\ arguments to \List\ and flags complex \Stream\ usages with review comments for manual review. A migration guide and detailed checklist are provided for the remaining behavioral and Kotlin-specific changes.
rewrite · high confidence
Global position tracking and backfill tooling for cross-stream ordering
The event store now supports a unified global position that assigns a single monotonic sequence number to every event across all streams, enabling cross-stream write-ordering and catch-up. A new \PositionBackfill\ utility has been added to retroactively assign positions to existing unpositioned events in MongoDB, with checkpointing and idempotent re-runs. An example \NameProjection\ demonstrates rebuilding a read model by replaying events in global position order, and the associated tests verify that position-based reads are rejected when the store opts out of stream position tracking.
eventstore/migration/position-backfill, example/projection/global-position-catchup · high confidence
Introduce CloudEventTypeMapper and related interfaces for domain-to-cloud event type mapping
Added new Java interfaces—CloudEventTypeGetter, DomainEventTypeGetter, and CloudEventTypeMapper—to define how domain event types are mapped to and from CloudEvent types. The CloudEventTypeMapper interface extends both getters to provide a unified contract for bidirectional type mapping. Kotlin extension functions were added to CloudEventTypeMapper and DomainEventTypeGetter to simplify usage in Kotlin code. A test demonstrates a custom implementation of CloudEventTypeMapper that maps domain events to CloudEvent types using simple names.
application/cloudevent-type-mapper/api · high confidence
Introduce DcbDecider and Kotlin DSL for Domain Command Boundary
Adds a new \DcbDecider\ type that couples a standard \Decider\ with its DCB boundary criteria and event tags. The \dsl/dcb-dsl/common\ module now provides Kotlin extension functions to construct and compose \DcbDecider\ instances, including a \dcbDecider\ factory that builds from parts without naming an intermediate \Decider\, and \compose\ functions that merge multiple deciders into a single composite. This enables users to define command routing and event tagging directly within the DSL, with composed deciders routing commands to the correct child boundary and unioning their tags.
dsl/dcb-dsl/common · high confidence
Introduce Dynamic Consistency Boundary (DCB) API for optimistic concurrency control
Adds a new DCB API that enables optimistic conflict detection for event appends. Users can now define append conditions based on event criteria (types, tags) and consistency tokens to ensure writes fail if conflicting events are detected. The package includes the DcbEventStore interface for reading and appending events, DcbCriteria for defining match conditions, DcbAppendCondition for specifying conflict rules, and DcbConsistencyToken for safe concurrency boundaries. This allows applications to enforce consistency boundaries without relying on global locks.
eventstore/api/dcb/src/main · high confidence
Introduce Dynamic Consistency Boundary (DCB) support and raise Java baseline to 21
This release introduces Dynamic Consistency Boundary (DCB) support, allowing commands to enforce consistency rules across multiple entities without forcing them into a single stream or aggregate. To support this, the event store gained an explicit capability set (STREAM, DCB, or both), a query and append-condition model with a consistency token for the optimistic check, and a new \DcbDecider\ type. The write API has been updated to use \List\ instead of \Stream\ for event store writes, and the synchronous side-effect utility \PolicySideEffect\ was renamed to \SideEffect\. Additionally, the project now requires Java 21, and catch-up subscriptions now run on Java virtual threads to avoid common-pool starvation.
(repo-wide) · high confidence
Introduce EventStoreCapability enum and CloudEvent extension constants
Added the EventStoreCapability enum to define supported event-store modes (STREAM and DCB) and introduced the EventStoreCloudEventExtensions class to hold the 'dcbtags' CloudEvent extension name, enabling the system to distinguish between stream-written and Dynamic Consistency Boundary-written events. The package also includes a nullness default via JSpecify annotations.
common/eventstore-capability · medium confidence
Introduce Spring-based MongoDB checkpoint storage
Added a new Spring-based implementation of the checkpoint storage interface for MongoDB, allowing applications using Spring to persist subscription checkpoints in MongoDB with built-in retry logic and null-safety annotations.
subscription/mongodb/spring/blocking-position-storage/src/main · high confidence
Introduce StreamReadFilter for constrained stream reads
Added internal support for filtering stream reads via a new \StreamReadFilter\ API, including a validator that prevents constraining reserved fields like \streamId\ and \streamVersion\. The \StreamReadFilterToFilterMapper\ converts these filters into reusable \Filter\ objects, enabling consistent filtering logic across different event store implementations.
eventstore/api/common/src/main/java/org/occurrent/eventstore/api/internal · medium confidence
Introduce View DSL for building materialized views
Added the view-dsl module, which provides a new API for creating materialized views. This includes the \View\ interface for defining state evolution from events, a \MaterializedView\ interface for updating state from event streams, and a \ViewStateRepository\ interface for persisting view state. The package is annotated with JSpecify nullness markers to enforce null-safety.
dsl/view-dsl/src/main/java · high confidence
Introduce blocking API for scheduling and managing deadlines
The blocking API for deadlines has been introduced, providing a new way to schedule, track, and cancel time-based events. The core \Deadline\ interface is now a sealed interface with specific implementations for \Instant\, \ZonedDateTime\, \OffsetDateTime\, and \LocalDateTime\, allowing users to create deadlines from various time sources. Additionally, the \DeadlineScheduler\ interface enables scheduling and cancellation of deadlines, while the \DeadlineConsumer\ and \DeadlineConsumerRegistry\ interfaces allow registering callbacks to be invoked when deadlines occur. This change modernizes the deadline handling mechanism, supporting both immediate and future-dated deadlines with type-safe data association.
deadline/api/blocking · high confidence
Introduce blocking DCB application service
Added a new blocking application service for the Dynamic Consistency Boundary (DCB). The \DcbApplicationService\ interface allows executing a domain function against events selected by a \DcbCriteria\ query, supporting optional post-append side-effects. This provides a synchronous, blocking API counterpart to the existing stream-based service.
application/service/blocking/src/main/java/org/occurrent/application/service/blocking/dcb · high confidence
Introduce blocking DSL module for command dispatching
The blocking DSL module now provides a \module\ function and associated types (\Module\, \ModuleBuilder\, \CommandDispatcher\, \BasicCommandDispatcher\) that allow users to define and dispatch commands in a blocking context. This includes the ability to register command dispatchers and subscriptions within a module, enabling a structured way to handle commands and events in a blocking execution model.
dsl/module-dsl/blocking/src/main · medium confidence
Introduce reactive application service and side-effect support
Added a new reactive application service interface that enables asynchronous domain model execution and event appending via Reactor's Mono, along with a SideEffect interface for running asynchronous side-effects after writes. The change also introduces Kotlin extension functions for constructing ExecuteFilter and ExecuteOptions, and provides a reactive DcbApplicationService for dynamic consistency boundary queries.
application/service/reactor/src/main · high confidence
Introduce shared application service filter and DCB tag generation interfaces
Added the \ExecuteFilter\ interface to provide a unified, fluent way to filter domain events by type for both blocking and reactive application services. Additionally, introduced the \TagGenerator\ interface and its \compose\ factory methods to derive Dynamic Consistency Boundary (DCB) tags from domain events before they are stored as CloudEvents. Both new interfaces are annotated with \@NullMarked\ to enforce null-safety across the \application.service\ and \application.service.dcb\ packages.
application/service/common · medium confidence
Introduced internal lock service and exception for competing consumer strategy
Added the \LostLockException\ class and the \MongoListenerLockService\ which handles acquiring, refreshing, and committing locks for competing subscribers in the MongoDB-based competing consumer strategy. The \MongoListenerLockService\ implements the core logic for managing subscription locks, including handling race conditions where multiple subscribers might attempt to acquire the same lock simultaneously. This change provides the underlying mechanism for ensuring only one subscriber holds a lock at any given time, with specific handling for duplicate key errors and lease expiration.
subscription/mongodb/common/blocking/competing-consumer-strategy · high confidence
Introduces a reactive Domain Command Bus (DCB) DSL for Kotlin
Adds a new reactive DSL for the Domain Command Bus, providing Kotlin-idiomatic extensions for executing commands and subscribing to domain events. The \DcbApplicationServiceDeciderExtensions\ file introduces \execute\ and \executeAndReturnDecision\ methods that accept a \DcbDecider\ to automatically resolve the read boundary and apply event tags, while \DcbDomainEventEventQueriesExtensions\ adds convenience methods like \queryForList\ and \types\ for querying domain events. Additionally, \DcbSubscriptions\ provides a reactive subscription entry point with metadata support, enabling users to build reactive event-driven applications with a simplified, fluent API.
dsl/dcb-dsl/reactor/src/main/kotlin · high confidence
Introduces blocking stream catch-up subscription model
Adds the core implementation for blocking stream catch-up subscriptions, including the abstract model, a position-based replay pipeline, and Kotlin/Java utility classes to specify start positions. This provides the foundational plumbing for durable, blocking subscriptions to catch up on historical events.
subscription/util/blocking/stream-catchup-subscription/src/main · high confidence
Introduces foundational domain types and application bootstrap for course enrollment
The course-enrollment example now includes the core domain building blocks: shared types for CourseId and StudentId, marker interfaces for DomainCommand and DomainEvent, and a Spring Boot Bootstrap class that configures the Occurrent MongoDB starter and event type mapping. This provides the structural foundation for the domain's command and event handling.
example/domain/course-enrollment/src/main/kotlin · medium confidence
Introduction of Spring-based blocking MongoDB event store
Added SpringMongoEventStore, a new implementation of the event store API using Spring's MongoTemplate. This component enables applications to persist and query events in MongoDB with support for stream-based and Dynamic Consistency Boundary (DCB) operations, including configurable read/query options and transactional write paths.
eventstore/mongodb/spring/blocking/src/main · high confidence
Kotlin extensions for CloudEvent conversion
Added Kotlin extension functions to simplify the creation of Jackson-based CloudEvent converters. The new \jacksonCloudEventConverter\ function allows Kotlin users to configure and build a \JacksonCloudEventConverter\ with custom mappers for ID, type, subject, and time, streamlining the setup process for CloudEvents serialization.
application/cloudevent-converter/jackson/src/main · medium confidence
Kotlin extensions for DCB execution and side-effects
Added Kotlin extension functions for the DCB application service, providing nullable return types for execute operations and convenient builders for execute options and side-effects. The \executeOrNull\ functions return \DcbAppendResult?\ instead of Java's \Optional\, and new \dcbExecuteOptions\ and \dcbSideEffect\ helpers simplify the creation of execution configurations with typed side-effects.
application/service/blocking/src/main/kotlin/org/occurrent/application/service/blocking/dcb · high confidence
Kotlin extensions for blocking domain event queries
Added Kotlin extension functions to the blocking query DSL, providing idiomatic Kotlin APIs for querying domain events. This includes \queryForList\ and \queryForSequence\ overloads that return Kotlin \List\ and \Sequence\ types, as well as a \queryOne\ extension that returns a nullable type instead of an \Optional\. These extensions wrap the underlying Java \DomainEventQueries\ to improve Kotlin compatibility and usability.
dsl/query-dsl/blocking/src/main/kotlin · high confidence
Kotlin extensions for typed execute filters and options
Added Kotlin extension functions in the blocking application service to provide type-safe, reified helpers for constructing \ExecuteFilter\ and \ExecuteOptions\. The new \ExecuteFilters\ object and top-level functions allow Kotlin developers to create typed filters and configure side effects with improved type inference, while maintaining source compatibility with deprecated top-level aliases.
application/service/blocking/src/main/kotlin/org/occurrent/application/service/blocking · high confidence
Native (non-Spring) appointment-scheduling example added
A new example demonstrates the appointment-scheduling domain using a native-driver MongoDB event store with the DCB capability, a Jackson 3 cloud event converter, an annotation-based tag generator, and a Javalin web server. The example wires the application service, deciders, and queries without Spring, providing a standalone, non-Spring implementation of the domain logic and a local launcher for testing.
example/domain/appointment-scheduling · high confidence
Native MongoDB filter conversion for condition and filter types
The MongoDB native module now includes internal converters that translate application-level query conditions and filters into MongoDB Bson filters. Specifically, ConditionConverter maps logical operators (AND, OR, NOT) and single-operand conditions (EQ, LT, GT, etc.) to Bson criteria, while FilterToBsonFilterConverter handles the full filter tree, including capability-based filtering for DCB-tagged events. This enables the system to execute native MongoDB queries for all supported condition and filter types.
common/mongodb/native/filter-bsonfilter-conversion · high confidence
New CloudEvent converters and typed execute filters
Added new CloudEvent converters for generic, Jackson, Jackson3, and XStream serialization, along with a typed ExecuteFilter for the blocking application service. The Jackson3 converter supports time precision truncation, and the ExecuteOptions record allows configuring stream read filters and side-effects during command execution.
test-support · high confidence
New Kotlin extensions for command composition and partial function application
Added new Kotlin extension functions in the \command\ package: \CompositionExtensions.kt\ provides \andThen\ infix notation and \composeCommands\ functions to compose multiple commands that operate on lists of domain events, while \PartialExtensions.kt\ introduces \partial\ functions that allow partial application of multi-argument functions, supporting up to 15 parameters. These additions enable developers to compose and partially apply command handlers in a more idiomatic Kotlin style.
application/command-composition/src/main/kotlin · high confidence
New Spring Boot autoconfiguration for Dynamic Consistency Boundaries
A new autoconfiguration module for the word-guessing-game example introduces support for Dynamic Consistency Boundaries (DCB) in Spring Boot applications. The \Bootstrap\ class registers essential beans, including a \DcbDecider\ that couples a domain decider with its DCB boundary and tags, alongside a \TagGenerator\ and cloud event converters. The \application.yaml\ enables the \dcb\ capability in the event store, and the context is restricted to DCB operations, explicitly rejecting standard stream event store APIs. A corresponding test verifies that the Spring context initializes correctly with only DCB-related beans and that non-DCB operations are properly rejected.
example/domain/word-guessing-game/mongodb/spring/dcb-autoconfig · high confidence
New Spring Boot example for ad-hoc MongoDB event store projections
Added a new example demonstrating how to build ad-hoc projections using Spring Boot with a MongoDB event store. The change introduces the application bootstrap class, a JUnit 5 integration test that validates querying the event store for workout statistics, and the necessary configuration files (logback.xml, package-info.java) to support the example.
example/projection/spring-adhoc-eventstore-mongodb-queries · high confidence
New View DSL for building materialized views
The view-dsl module introduces a new domain-specific language for constructing materialized views. This includes extension functions to evolve view state from single or multiple events, supporting varargs, List, Sequence, and Iterable sources. It also provides utilities for subscribing to event streams to update views, with specific support for Spring Data MongoDB integration via the SpringMongoViewExtensions.
dsl/view-dsl/src/main/kotlin · high confidence
New annotations for DCB and stream subscriptions
Added the @DcbSubscription annotation for managing persistent, durable subscriptions to Dynamic Consistency Boundary (DCB) events, allowing filtering by event types and tags with configurable start positions and resume behaviors. Also introduced @StreamSubscription for stream-based subscriptions and @DcbTag to mark domain event members as DCB tag sources. These new annotations provide a more explicit, capability-agnostic and capability-specific subscription model compared to the existing @Subscription annotation.
framework/annotations · high confidence
New application support modules for CloudEvent conversion and type mapping
The project has introduced new Maven modules to support CloudEvent conversion and type mapping. This includes the \cloudevent-converter\ module, which provides implementations for converting domain events to and from CloudEvents using Jackson, Jackson 3, and XStream. Additionally, the \cloudevent-type-mapper\ module offers APIs and reflection-based implementations for mapping domain types to CloudEvent types. These modules are part of the \application\ parent, which also contains the \command-composition\ and \service\ modules, establishing a new structure for application-specific support libraries.
(dependencies) · high confidence
New blocking ApplicationService interface with typed execute filters and side-effect support
The blocking application service now exposes a new {@code ApplicationService} interface that supports typed execute filters and synchronous side-effects. Users can now pass an {@code ExecuteFilter} or an {@code ExecuteOptions} object to control which events are loaded and how side-effects are executed after writes. A new {@code SideEffect} utility interface and helper methods allow composing and running domain-specific side-effects (e.g., logging, publishing) after events are persisted. The service also returns a {@link WriteResult} to indicate write outcomes. This replaces the previous simpler execute overloads, which are now deprecated.
application/service/blocking/src/main/java/org/occurrent/application/service/blocking · high confidence
New blocking event store API interfaces for writes, queries, and operations
The blocking event store API now exposes a set of new interfaces that define how applications interact with the event store. Developers can now perform conditional and unconditional writes via \ConditionallyWriteToEventStream\ and \UnconditionallyWriteToEventStream\, which return a \WriteResult\ containing metadata like the stream version. Querying capabilities are provided through \EventStoreQueries\, which supports filtering, sorting, counting, and existence checks. Additionally, \EventStoreOperations\ introduces advanced operations such as deleting event streams or individual events, and updating events. The \EventStream\ interface provides a typed, iterable view of events with mapping support. These changes introduce new methods and return types, which may require updates to existing implementations of the event store.
eventstore/api/blocking/src/main/java · high confidence
New blocking subscription model interfaces and adapters
The blocking subscription API now introduces a set of new interfaces and adapters to support typed subscription models. A new \SubscriptionModel\ interface extends \Subscribable\ and \SubscriptionModelLifeCycle\ to manage subscription lifecycles (start, stop, pause, resume, cancel). The \Subscribable\ interface defines the core \subscribe\ methods for creating and managing subscriptions. Additionally, \StreamSubscriptionModel\ and \DcbSubscriptionModel\ interfaces are introduced to provide typed views for stream and DCB (Dynamic Consistency Boundary) subscriptions, each with corresponding adapter implementations (\StreamSubscriptionModelAdapter\, \DcbSubscriptionModelAdapter\) that translate specific subscription types into the shared \SubscriptionModel\. A \CheckpointAwareSubscriptionModel\ interface is added to support checkpointing for subscriptions, and a \CheckpointStorage\ interface is introduced to manage checkpoint data. A \CompetingConsumerStrategy\ interface is also added to handle competing consumer scenarios. These changes provide a more structured and flexible way to manage blocking subscriptions, with support for different subscription types and lifecycle management.
subscription/api/blocking · high confidence
New in-memory filter matching implementation
A new \filter-matching\ module has been added to the \common/inmemory\ area, introducing \ConditionMatcher\ and \FilterMatcher\ classes that evaluate CloudEvents against filter conditions. This enables in-memory event stores to support querying on all fields except the \data\ field, which currently throws an \IllegalArgumentException\ with a note about future support.
common/inmemory/filter-matching · high confidence
New reactive Spring Boot starter for MongoDB event sourcing
Added a new reactive Spring Boot starter for MongoDB that enables automatic configuration of the reactive (Project Reactor) stack. This includes the @EnableOccurrentReactive annotation, an autoconfiguration class that wires up the reactive event store, subscription models, and annotation processors for @Subscription, @StreamSubscription, and @DcbSubscription, allowing users to build reactive event-driven applications with MongoDB.
framework/spring-boot-starter-mongodb-reactive/src/main · high confidence
New reactive event store API interfaces for conditional writes, advanced queries, and stream operations
The reactive event store API now exposes a richer set of interfaces to support more granular control over event store interactions. Developers can now perform conditional writes to event streams, execute advanced filtering and sorting queries, check for stream existence, and perform delete and update operations on individual events. These additions provide a more comprehensive API for reactive event store implementations.
eventstore/api/reactor · high confidence
New reactive subscription and lifecycle management APIs
The reactive subscription API has been refactored to support named, lifecycle-managed subscriptions. A new \Subscribable\ interface allows subscriptions to be tracked by ID, enabling pause, resume, and cancellation of individual subscriptions. A \SubscriptionModelLifeCycle\ interface provides methods to stop, start, and manage the state of the subscription model itself. Additionally, a \DcbSubscriptionModel\ interface is introduced for subscribing to DCB events using criteria, and \CheckpointAwareSubscriptionModel\ and \CheckpointStorage\ interfaces are added to support manual checkpoint management for subscriptions.
subscription/api/reactor/src/main · high confidence
Reactive MongoDB subscription model with named, lifecycle-managed subscriptions
The ReactorMongoSubscriptionModel class has been introduced to provide a reactive subscription model for MongoDB change streams. This implementation supports named, lifecycle-managed subscriptions, allowing users to pause, resume, and cancel individual subscriptions by ID. The model is resilient to change-stream errors and handles cases where MongoDB servers do not support the hostname command by falling back to the local client time. Additionally, the package is annotated with @NullMarked from JSpecify to enforce null-safety across the module.
subscription/mongodb/spring/reactor/src/main · high confidence
Simplified Kotlin API for retry execution and info access
The retry module now provides Kotlin-specific extension functions to improve developer experience. A new \exec\ function on \RetryStrategy\ allows executing retry logic with a lambda instead of a Java \Supplier\, avoiding the need for explicit type casting or SAM conversion. Additionally, new extension properties on \AfterRetryInfo\ and \ErrorInfo\ expose the failed exception and next backoff duration as nullable types (\Throwable?\ and \Duration?\), removing the need to handle Java \Optional\ wrappers.
common/retry/src/main/kotlin · medium confidence
Word hint feature implementation for the guessing game example
The word guessing game example now includes a word hint feature that reveals characters in the target word. Two new event handlers manage this behavior: one reveals initial characters when the game starts, and another reveals additional characters when a player guesses incorrectly. Both handlers use Spring's @Retryable annotation to handle transient failures during event processing.
example/domain/word-guessing-game/mongodb/spring/blocking/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/blocking/features/wordhint · high confidence
Architecture
Extract shared MongoDB DCB storage and mapping logic into a common module
The MongoDB event store implementation now uses a dedicated \dcb-common\ module containing shared classes for DCB storage contracts, document mapping, and marker models. This centralizes the handling of DCB-specific fields (such as tags and position) in MongoDB documents, ensuring that both the event store and DCB subscription components use the same storage contract and serialization logic.
eventstore/mongodb/dcb-common · high confidence
Extracted MongoDB subscription filtering and checkpointing logic into a shared base module
The MongoDB subscription implementation has been refactored to extract shared code into a new common base module. This introduces a new \MongoFilterSpecification\ class to handle server-side filtering for change streams, including support for DCB (Data Change Block) criteria, tags, and type-based matching. Additionally, the module now contains internal utilities for handling MongoDB resume tokens, operation times, and generic checkpoints, along with a converter that translates DCB criteria into MongoDB aggregation pipeline stages. These changes improve code reuse and simplify the main subscription implementation by centralizing MongoDB-specific filtering and state management.
subscription/mongodb/common/base · high confidence
Behavioural changes
Add Jackson 3 CloudEvent converter with configurable time precision
Introduces a new Jackson 3-based CloudEvent converter that supports configuring the precision to which event timestamps are truncated, allowing users to control sub-millisecond time resolution in CloudEvents. The change also adds JSpecify nullness annotations across the Java packages and upgrades the project to Spring Boot 4.0.4 and Jackson 3.
application/cloudevent-converter/core, application/cloudevent-converter/jackson3 · medium confidence
Added Codex rules for Maven commands
New rules were added to the .codex/occurrent-sandbox.rules file to explicitly allow specific Maven command patterns, including test execution, compilation, and clean operations.
.codex · high confidence
Added Kotlin extension for condition matching
A new Kotlin extension function isIn is now available in the common/filter module, allowing users to check if a value is contained within a collection or a set of vararg values. Additionally, JSpecify nullness annotations have been applied to the org.occurrent.condition and org.occurrent.filter packages to improve null-safety.
common/filter · medium confidence
Blocking subscription DSL now supports event metadata and configurable start behavior
The blocking subscription DSL has been updated to include EventMetadata (containing stream version and stream ID) in subscription callbacks, allowing users to build projections more effectively. Additionally, the subscribe methods now accept a waitUntilStarted parameter to control whether the subscription waits for the event store to be ready before returning. The DSL also introduces a capability-agnostic subscriptions entry point that routes through an AgnosticSubscriptionFilter, providing a unified way to subscribe to both stream-written and DCB-appended events.
dsl/subscription-dsl/blocking/src/main · medium confidence
CloudEvents extension keys renamed and SDK upgraded to 2.0.0
The Occurrent CloudEvents extension keys have been renamed from "streamId" and "streamVersion" to "streamid" and "streamversion" to comply with the CloudEvents specification. This change is accompanied by an upgrade to the CloudEvents Java SDK 2.0.0 milestone 2, which introduces breaking changes to the SDK's API. Additionally, a new utility class, OccurrentExtensionRemover, has been added to allow users to strip Occurrent-specific extensions from CloudEvents.
cloudevents-extension · medium confidence
Durable subscription config classes now enforce null-safety via JSpecify
The configuration classes for durable subscriptions (both blocking and reactor variants) now include JSpecify annotations (@NullMarked, @Nullable) to enforce null-safety. This change ensures that the persistCloudEventPositionPredicate and other fields are properly annotated, reducing the risk of NullPointerExceptions and improving static analysis for developers using these APIs.
subscription/util/blocking/durable-subscription, subscription/util/reactor/durable-subscription/src/main · high confidence
Enhanced sorting API and improved error handling for event store queries
The event store API now supports flexible, composable sort specifications via the new \SortBy\ interface, allowing queries to be ordered by time, stream version, or natural insertion order. By default, queries without an explicit sort specification will now return events in an unsorted order (\SortBy.unsorted()\). Additionally, \DuplicateCloudEventException\ now includes a \details\ field to provide more context about why a duplicate was detected, and \WriteConditionNotFulfilledException\ has been updated to include the specific \WriteCondition\ that failed, improving debugging for concurrent write conflicts.
eventstore/api/common/src/main/java/org/occurrent/eventstore/api · high confidence
Exclude Occurrent from Spring Boot DevTools hot reload
A new configuration file, spring-devtools.properties, has been added to the Spring Boot starter's resources. This change configures Spring Boot DevTools to exclude the 'occurrent' library from automatic hot-reload triggers, preventing unnecessary application restarts during development.
framework/spring-boot-starter-mongodb/src/main/resources · high confidence
Extracted shared Spring Boot autoconfiguration for stack-neutral components
The Spring Boot autoconfiguration for the MongoDB event store has been refactored to extract stack-neutral components into a shared module. This includes a new \Jackson3CloudEventConverterConfiguration\ that configures the default \CloudEventConverter\ using Jackson 3, automatically discovering Jackson modules for Kotlin and \java.time\ support. Additionally, \OccurrentProperties\ now exposes configuration for the cloud event converter, including \cloudEventSource\ and \timePrecision\ settings. Several Spring \Condition\ classes (e.g., \OnDcbEventStoreCapabilityCondition\, \OnPositionEnabledCondition\) have been added to the common package to gate bean creation based on event store capabilities and position settings.
framework/spring-boot-autoconfigure-mongodb-common · high confidence
Fixes in command composition and added internal utilities
A bug in command composition that accidentally included 'previous events' when invoking the generated composition function has been fixed. Additionally, new internal classes were added: CreateListFromVarArgs for building lists from variable arguments, and SequentialFunctionComposer for composing sequential functions. The package-info.java was also added to mark the internal package with JSpecify nullness defaults.
application/command-composition/src/main/java/org/occurrent/application/composition/command/internal · medium confidence
Improved CloudEvent content-type handling in MongoDB event store
The MongoDB event store now includes a new ContentType utility class that explicitly handles content-type detection for CloudEvents. This adds support for text content types (text/\*, /xml, +xml, +csv) and enforces application/json as the default when the content-type is undefined, aligning with the CloudEvents specification. The package is also marked with JSpecify's @NullMarked annotation to enforce null-safety conventions.
eventstore/mongodb/common/src/main/java/org/occurrent/eventstore/mongodb/cloudevent · high confidence
Improved error handling for concurrent write conflicts in MongoDB event store
The MongoDB event store implementation now provides more accurate exception handling for concurrent write conditions. A new internal exception translator distinguishes between genuine duplicate CloudEvent errors and version conflicts caused by parallel writers, ensuring that a WriteConditionNotFulfilledException is correctly thrown when multiple threads attempt to update the same stream simultaneously. Additionally, the internal StreamVersionDiff class now exposes the old stream version, allowing for more precise error reporting when write conditions are not fulfilled.
eventstore/mongodb/common/src/main/java/org/occurrent/eventstore/mongodb/internal · high confidence
Introduce dedicated tag helper objects for course and student entities
New internal helper objects, CourseTags and StudentTags, have been added to the course management and student management model packages respectively. These objects encapsulate the creation of specific Tag instances for course and student entities, providing a consistent way to generate tags for event store queries.
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/coursemanagement/model, example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/studentmanagement/model · medium confidence
Introduce generic PartialFunctionApplication to replace specialized command application classes
The specialized PartialListCommandApplication, PartialStreamCommandApplication, and PartialApplicationFunctions have been removed and replaced by a single, generic PartialFunctionApplication class. This new utility supports partial function application for functions with up to 13 parameters, allowing users to create partial functions for any kind of function, not just those taking Stream or List. Additionally, the package now includes a @NullMarked annotation via package-info.java to enforce nullness defaults across the Java packages.
application/command-composition/src/main/java/org/occurrent/application/composition/command/partial · high confidence
Introduce internal SortConverter for MongoDB sort handling
Added a new internal SortConverter class that maps Occurrent's SortBy types to Spring Data's Sort objects, including support for natural sorting and multiple sort steps. The package is marked with @NullMarked for null-safety. This change improves compatibility with MongoDB 7.0+ by rejecting invalid sort combinations that older MongoDB versions would silently degrade.
common/mongodb/spring/sort-conversion · medium confidence
Introduces a new CatchupReader interface for stream catch-up logic
A new CatchupReader interface has been added to the org.occurrent.subscription.reactor.durable.catchup package, defining a data-access seam for replaying events in position order and retrieving the current head position. This interface, marked with JSpecify's @NullMarked annotation, provides methods to read a window of CloudEvents and query the store's high-watermark, supporting the reactive catch-up model.
subscription/util/reactor/stream-catchup-subscription/src/main · medium confidence
Null-safety annotations added across Java packages
The codebase now uses JSpecify's @NullMarked annotation across multiple Java packages, including the CloudEvent converter, service layers, DSLs, and event store implementations. This change enables stricter null-safety checking by the compiler, helping to prevent null pointer exceptions and improve code reliability.
(repo-wide) · high confidence
Number Guessing Game example updated with new view and configuration components
The number guessing game example has been restructured with new components: a \NumberGuessingGameConfig\ for externalized game settings, a \GameStatus\ view to track game progress, and a \LatestGamesOverview\ interface for listing recent games. Additionally, the example now includes a redirect controller to route the root path to the games page, and all Java files have been updated with Apache 2.0 license headers and JSpecify nullness annotations.
example/domain/number-guessing-game/mongodb/spring/blocking/src/main/java · high confidence
Refactored MongoDB subscription filter application to support capability-agnostic and DCB-specific filtering
The internal logic for applying filters to MongoDB change streams has been refactored into a dedicated builder class. This change introduces support for capability-agnostic subscriptions, which now apply plain filters directly to the change stream, while DCB (Document Change Bundle) subscriptions are converted into specific match stages. This separation ensures that stream and DCB scoping logic is correctly handled, preventing startup failures for capability-agnostic subscriptions.
subscription/mongodb/spring/common · medium confidence
Refactored Number Guessing Game model to use Java 21+ pattern matching and sealed interfaces
The NumberGuessingGame model was refactored to modernize the Java implementation. The domain events are now defined using a sealed interface (GameEvent) with specific event types, replacing the previous structure. The core game logic in NumberGuessingGame now utilizes Java's pattern matching for switch statements to handle event rehydration, and uses List instead of Stream for event store writes. Additionally, nullness annotations (JSpecify) were added to the package-info files.
example/domain/number-guessing-game/model · high confidence
Refactored internal retry execution to use an iterative loop and improved interrupt handling
The internal retry execution logic in the \org.occurrent.retry.internal\ package has been refactored to replace the previous recursive approach with an iterative loop, which helps avoid stack overflow issues during deep retry chains. The implementation now properly restores the thread's interrupt status when a backoff sleep is interrupted, allowing callers to distinguish between genuine retry exhaustion and external interruptions. Additionally, the internal \RetryInfo\ and \SafeExceptionRethrower\ classes have been updated to support the new iterative structure and null-safety annotations.
common/retry/src/main/java/org/occurrent/retry/internal · high confidence
Refactored retry strategy API with new info interfaces and callback hooks
The retry module has been refactored to provide richer context to users during retry operations. New interfaces—RetryInfo, ErrorInfo, BeforeRetryInfo, and RetryableErrorInfo—expose details such as attempt counts, backoff durations, and whether an error is retryable. The RetryStrategy interface now supports functional callbacks (e.g., onBeforeRetry, onAfterRetry, onError) that receive these info objects, allowing users to react to specific retry states. The Backoff mechanism is now a sealed interface with fixed and exponential implementations, and the package is annotated with JSpecify @NullMarked for improved null-safety.
common/retry/src/main/java/org/occurrent/retry · medium confidence
Refactored subscription model and added Spring/MongoDB projection example
The \AutoPersistingSubscriptionModel\ has been renamed to \DurableSubscriptionModel\, and the generic type \T\ has been removed from the subscription interface as part of a broader refactoring of subscription models. This change is accompanied by the addition of a new example module for Spring-based MongoDB projections, which includes the \CurrentName\ entity, its corresponding Spring Data repository interface (\CurrentNameProjection\), and a \CurrentNameProjectionUpdater\ component that processes domain events to update the projection. The application bootstrap class configures the necessary beans, including a \DurableSubscriptionModel\ that wraps the base subscription model with checkpoint storage, and utilizes the \org.occurrent\ package structure.
example/projection/spring-subscription-based-mongodb-projections/src/main · medium confidence
Removal of in-memory event store and core interfaces
The in-memory event store implementation and its associated test domain classes have been removed from the codebase. Additionally, the core \EventStore\, \EventStream\, \ReadEventStream\, and \WriteEventStream\ interfaces have been deleted from \occurrent-core\. This change eliminates the ability to use an in-memory event store for testing or development, as the supporting infrastructure and domain models are no longer present.
occurrent-core, occurrent-inmemory · high confidence
Renamed SubscriptionPosition to Checkpoint and added nullness annotations
The \SubscriptionPosition\ type has been renamed to \Checkpoint\ to better reflect its role as a per-subscriber resume marker. The \Checkpoint\ interface now includes a \@NonNull\ annotation on its \asString()\ method. Additionally, nullness defaults have been applied across the \org.occurrent.subscription\ and \org.occurrent.subscription.internal\ packages using \@NullMarked\ from the JSpecify library, ensuring stricter null-safety for these components.
subscription/core/src/main · medium confidence
Require explicit @EnableOccurrent annotation to activate MongoDB autoconfiguration
The Spring Boot starter for MongoDB no longer autoconfigures itself simply by being on the classpath. To enable Occurrent's MongoDB integration, you must now annotate your Spring Boot application class with @EnableOccurrent. This change removes the need for the previous OccurrentMongoRegistrar and improves IDE compatibility. Additionally, the default transaction manager is now configured with 'majority' read and write concerns, and the subscription model supports virtual threads when 'spring.threads.virtual.enabled' is true.
framework/spring-boot-starter-mongodb/src/main/java · high confidence
Spring Boot 4.0.4 and Jackson 3 upgrade with package restructuring
The example application has been upgraded to Spring Boot 4.0.4 and Jackson 3, requiring the use of \jakarta.annotation\ imports instead of \javax.annotation\. The codebase has been restructured with a package rename from \se.haleby.occurrent\ to \org.occurrent\, and the \EventForwarder\ component now utilizes the \ReactorDurableSubscriptionModel\ for event streaming, while the application configuration wires up the necessary beans for MongoDB and CloudEvent conversion.
example/forwarder/mongodb-subscription-to-spring-event/src/main · medium confidence
Spring transactional projection example updated for Spring Boot 4 and Jakarta EE 2.11
The Spring transactional projection example for MongoDB has been updated to use Spring Boot 4.0.4 and Jackson 3, and migrated to Jakarta EE 2.11 (replacing javax with jakarta annotations). The example now includes a \CurrentName\ entity, a \CurrentNameProjection\ repository, and a \NameApplicationService\ that handles name definition and change events, all configured within a Spring Boot application that sets up a \MongoTransactionManager\ for transactional projections.
example/projection/spring-transactional-projection-mongodb/src/main · medium confidence
Styled course enrollment page with Pico.css
The course enrollment web interface now uses the Pico.css framework (v2.0.6) for its visual design. This adds a consistent, modern look to the page, including styled feedback messages, an activity feed, and aligned action buttons for course cancellation and student deregistration.
example/domain/course-enrollment/src/main/resources/static · high confidence
Test coverage
Added DomainQuery interface for domain queries; Added Kotlin extension tests for JacksonCloudEventConverter; Added Kotlin-specific retry strategy tests; Added RPS example tests and demo classes; Added comprehensive tests for the native MongoDB event store; Added integration test for Spring MongoDB subscription-based projections; Added integration tests for MongoDB event forwarding; Added integration tests for Spring transactional projections with MongoDB; Added integration tests for reactive transactional projections with MongoDB; Added integration tests for the reactive Spring MongoDB event store; Added test infrastructure for the Spring Boot number guessing game; Added test support classes for name-defined events; Added tests for CloudEvent content-type handling and MongoDB document mapping; Added tests for DCB DSL and application service extensions; Added tests for DCB application service extensions and execute options; Added tests for DCB domain event query shortcuts and consistency token handling; Added tests for DCB subscription model adapter; Added tests for DcbStartAt and DurationToTimeoutConverter; Added tests for DomainEventQueries; Added tests for Dynamic Consistency Boundary (DCB) subscription auto-configuration and annotations; Added tests for InMemoryEventStore DCB, position ordering, and duplicate detection; Added tests for Jackson-based CloudEvent conversion; Added tests for JobRunr deadline scheduling; Added tests for Kotlin application service helpers and execute options; Added tests for RetryStrategy error mapping and retry info; Added tests for Spring MongoDB blocking checkpoint storage; Added tests for Spring MongoDB blocking subscription model; Added tests for Spring MongoDB event store capabilities and DCB concurrency; Added tests for StreamReadFilter validation and mapping; Added tests for blocking application service filters and options; Added tests for blocking stream catch-up subscription model; Added tests for catch-up subscription model lifecycle and replay logic; Added tests for checkpoint storage with legacy field migration; Added tests for decider application service extensions and combinators; Added tests for in-memory subscription models; Added tests for list command composition; Added tests for multi-command decider operations; Added tests for stream catch-up subscription behavior; Added tests for the Dynamic Consistency Boundary (DCB) application service; Added tests for the ReactorDurableSubscriptionModel; Added tests for the Rock Paper Scissors decider model; Added tests for the View DSL, including MaterializedView and subscription extensions; Added tests for the XStream-based CloudEvent converter; Added tests for the blocking GenericApplicationService; Added tests for the dual-mode catch-up subscription model; Added tests for the reactive DCB DSL and subscriptions; Added tests for the reactive MongoDB subscription model; Added tests for the reactive application services; Added tests for the word-guessing-game DCB helpers; Added tests for word-guessing game gameplay features; Added unit tests for default subscription ID generation; Added unit tests for event store API components; Added unit tests for the Dynamic Consistency Boundary (DCB) API.
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
Baseline
- First survey — no prior run to compare against. CAI 63.
Lenses
- Code Health 94
- Architecture 99
- Maturity 75
- Readiness 50
- Security 62
- Domain Modelling 100
Changes since last survey
- 300 commits — 265 feature/other, 35 fixes
By area
- (root) — 68 commits
- example/domain — 33 commits
- .context/ORCHESTRATOR.md — 23 commits
- eventstore/mongodb — 22 commits
- subscription/util — 22 commits
- dsl/dcb-dsl — 19 commits
- application/service — 16 commits
- doc/architecture — 13 commits
- subscription/mongodb — 12 commits
- framework/spring-boot-starter-mongodb — 11 commits
- eventstore/api — 10 commits
- dsl/decider — 9 commits
- dsl/view-dsl — 6 commits
- eventstore/inmemory — 6 commits
- (repo) — 5 commits
- common/retry — 4 commits
- dsl/subscription-dsl — 3 commits
- framework/spring-boot-autoconfigure-mongodb-common — 3 commits
- subscription/api — 3 commits
- framework/spring-boot-starter-mongodb-reactive — 2 commits
Notable commits
- fix: Add a regression test proving DCB catch-up never redelivers a resumed-past position (#266)
- fix: Capture DCB catch-up resume token before the bulk replay to fix tail loss
- fix: Fix DCB reads matching non-DCB stream events (#280)
- fix: Fix DCB reads scanning or sorting in memory on skewed data (#303)
- fix: Fix Decider state-return nullness that broke Kotlin decision chaining (#317)
- fix: Fix Kotlin platform-type warning in CourseDetail.nameOf
- fix: Fix blocking module DSL execute extension usage
- fix: Fix broken Javadoc links and add ADR status lines (#291)
- fix: Fix capability-agnostic subscriptions throwing at startup on MongoDB (#290)
- fix: Fix dangling changelog cross-reference after the rename
- fix: Fix example profile compilation
- fix: Fix filtered stream-read behavior in eventstore implementations
- fix: Fix lazy fallback converter for 0.20.3
- fix: Fix ordering flake in the catch-up handover test (#212)
- fix: Fix outstanding Qodana findings from #262 (#265)
- fix: Fix remaining Kotlin execute extension usages
- fix: Fix review feedback on virtual threads
- fix: Fix silent event loss in CatchupSubscriptionModel under clock skew (#199)
- fix: Fix silent event loss in blocking catch-up subscriptions (#292)
- fix: Fix the false IntelliJ autowire warning on DcbApplicationService (#267)
- …and 280 more
Architecture
- 0 containers · 1 bounded contexts · 0 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
johanhaleby/occurrent 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 4 August 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 0d2b9cb30bdef51f6863f895d6f7eb478e2d6f9e — the exact code this score is about.
- Scored under rubric-2026.08.19 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer latest.