johanhaleby/occurrent
66.0
Adequate · 9 November 2026
155.6k
lines of production code
Java
with Kotlin
6
measurements over time
What this system is
Features
Add DCB-based point awarding and word hint features to the word guessing game
The word guessing game example now includes two new Dynamic Consistency Boundary (DCB) features implemented as Spring components. The point-awarding feature automatically awards points to a player when they guess the correct word, using a blocking DCB application service to check game state and prevent duplicate awards. The word-hint feature reveals characters in the word hint based on game progress: it reveals initial characters when the game starts and progressively reveals additional characters after each wrong guess, up to a defined limit. Both features use @StreamSubscription annotations to react to domain events and include retry logic for resilience.
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
Add Dynamic Consistency Boundary (DCB) example for the Word Guessing Game
This location introduces a new Spring Boot example demonstrating the Dynamic Consistency Boundary (DCB) pattern using MongoDB. It provides the application bootstrap configuration, a CloudEvent converter for domain events, and a sample subscription that triggers an email notification when a game is won. The setup explicitly enables only the DCB capability on the event store, disabling standard stream-based APIs to enforce the consistency model.
example/domain/word-guessing-game/mongodb/spring/dcb · high confidence
Add Dynamic Consistency Boundary support for point awarding and word hints
The Word Guessing Game example now supports Dynamic Consistency Boundaries (DCB) for specific features. This change introduces a CloudEvent converter to serialize and deserialize game events, enabling the system to process domain events asynchronously. Specifically, it adds handlers that award points to players who guess the correct word and reveal characters in the word hint after incorrect guesses, both implemented as reactive subscriptions with retry logic.
example-domain-word-guessing-game-eventstore-mongodb-spring-dcb, example/domain/word-guessing-game/mongodb/spring/dcb/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/features/pointawarding · high confidence
Add RabbitMQ broker example with order event projection
Introduces an end-to-end example for the RabbitMQ push feed, including the \OrderEvent\ domain model (sealed interface with \OrderPlaced\ and \OrderShipped\ records) and the \OrderStatusProjection\ read model. The projection demonstrates idempotent folding of events from RabbitMQ, handling both catch-up replays and live redeliveries while preserving CloudEvent metadata such as stream ID and version.
example-broker-rabbitmq · high confidence
Add blocking Kotlin DSL for subscription-fed and on-demand projections
New extension functions are added to the blocking Kotlin DSL to simplify building read models. Users can now use \Subscriptions.project\ (and its DCB and Stream variants) to automatically subscribe to domain events and materialize them into a \MaterializedView\ or \ViewStateRepository\. For strongly consistent, on-demand queries, \DomainEventQueries.project\ allows folding selected events into view state without maintaining a persistent subscription. Additionally, \SpringMongoProjectionExtensions\ provides a convenience \mongoViewStateRepository\ and corresponding \project\ overloads to seamlessly integrate these projections with MongoDB.
dsl/projection-dsl/blocking/src/main/kotlin · high confidence
Add blocking snapshot read and refresh API with in-memory store
This change introduces the blocking DSL for snapshot views, providing a new \SnapshotViews\ facade that allows users to explicitly read the current state of a view (\readState\) or trigger an explicit snapshot update (\refresh\) without relying on automatic decider-side snapshotting. It also includes a new \InMemorySnapshotStore\ implementation backed by a \ConcurrentHashMap\, suitable for testing, examples, and single-node best-effort caching scenarios.
occurrent-snapshot-dsl-blocking · high confidence
Add event-sourced Uno example with MongoDB native driver
A new event-sourced implementation of the Uno game example has been added to the native MongoDB module. This includes an application entry point that configures a MongoEventStore and a NativeMongoSubscriptionModel, utilizing virtual threads for blocking subscription work to track game progress. A standard Logback configuration has also been added to support console logging for this example.
example/domain/uno/mongodb/native · high confidence
Add example ledger decider with snapshot-ready terminal state
The closing-the-books example now includes a Ledger decider that manages opening balance, deposits, withdrawals, and a close-books operation. The decider enforces business rules such as preventing operations after the books are closed and ensuring withdrawals do not exceed the current balance. It exposes a terminal state via the isTerminal flag, which serves as the signal for snapshot policies to capture the final state.
example-snapshot-closing-the-books · high confidence
Add hotel dashboard feature with live room and guest overview
The hotel-booking example now includes a dashboard feature that displays a real-time overview of rooms and registered guests. An in-memory read model tracks room definitions, closures, bookings, cancellations, and guest registration/deregistration events, while a DCB subscriber keeps the model consistent from the beginning of the event stream. A web controller exposes this data via Thymeleaf templates, with the dashboard table designed for HTMX-based polling to reflect eventually-consistent updates without full page reloads.
example/domain/hotel-booking/src/main/kotlin/org/occurrent/example/domain/hotelbooking/features/hoteldashboard · high confidence
Add native Java appointment-scheduling DCB example
A new plain-Java, non-Spring example demonstrates the Dynamic Consistency Boundary (DCB) pattern using a native MongoDB driver, Javalin for the web layer, and annotation-based event tagging. The example implements a clinic scheduler that books appointments across clinician, patient, and time-slot entities within a single consistency boundary, providing a reference implementation for users who prefer manual wiring over Spring Boot.
example/domain/appointment-scheduling · high confidence
Add order fulfillment saga example with state and event models
The example-saga-order-fulfillment module now includes the foundational domain models for an order fulfillment saga, introducing command and event records (such as OrderPlaced, ReservePayment, PaymentReserved, PaymentFailed, ShipOrder, and CancelOrder) alongside a sealed interface for saga state (AwaitingPayment, Completed, Cancelled). This provides the concrete data structures and state transitions required to implement the event-driven process manager demonstrated in this location.
example-saga-order-fulfillment · high confidence
Add reactive hotel-booking example with cross-boundary consistency
This change introduces a reactive hotel-booking example that demonstrates Dynamic Consistency Boundaries (DCB) to enforce invariants across multiple entities. It adds a cross-boundary \BookingDecider\ that ensures a room is not double-booked and a guest stays within a booking limit by reading events from both the room and guest boundaries. The example includes a strongly consistent \RoomDetail\ read model for immediate post-booking views, an eventually consistent \HotelDashboard\, and a reactive \BookingController\ with a live activity feed via Server-Sent Events.
example-domain-hotel-booking, example/domain/hotel-booking/src/main/kotlin/org/occurrent/example/domain/hotelbooking/features/booking · high confidence
Add reactive hotel-booking example with guest and room management
This change introduces a new reactive hotel-booking example application that demonstrates Domain Command Boundaries (DCB) using Spring WebFlux. It adds web controllers and use-case layers for managing guests (registering and deregistering) and rooms (defining and closing), wired to a DcbApplicationService. The implementation includes specific tag models for scoping events to guests and rooms, and uses a fixed hotel ID in the room management controller for the demo.
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 · high confidence
Add reactive query DSL for domain events
This change introduces a new reactive query DSL in the \org.occurrent.dsl.query.reactor\ package, providing Kotlin extension functions for \DomainEventQueries\. Users can now query domain events by type or filter using idiomatic Reactor types (\Flux\ and \Mono\), with support for pagination (skip/limit), sorting, and position-based reads (e.g., \afterPositionForList\, \readInPositionOrderForList\). This complements the existing blocking DSL by offering reactive equivalents for common query patterns.
dsl/query-dsl/reactor/src/main/kotlin · high confidence
Add server-rendered course dashboard with HTMX polling
The course-enrollment example now includes a server-rendered web dashboard that displays course and student data. A new projection aggregates domain events (course definitions, cancellations, and student enrollments/unenrollments) into an in-memory read model, replaying from the beginning on every boot to ensure consistency. A Spring MVC controller serves the dashboard view, which uses HTMX to periodically poll for updates, allowing the eventually-consistent counters to refresh automatically without full page reloads.
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/coursedashboard · high confidence
Add server-rendered course enrollment dashboard and detail pages
This change introduces the server-side Thymeleaf templates for the course-enrollment example, providing a complete user interface for managing courses and students. The dashboard (index.html) allows users to define new courses and register students, while the dashboard fragment displays tables of existing courses and students with options to cancel courses or deregister students. The course detail page enables enrolling and unenrolling students via forms, displays live activity updates using Server-Sent Events (SSE), and includes a reusable feedback fragment for user notifications. All pages are styled with Pico.css and utilize HTMX for dynamic, partial page updates.
example/domain/course-enrollment/src/main/resources/templates · high confidence
Add word-guessing game gameplay features with Dynamic Consistency Boundary support
This change introduces the core gameplay logic and user interface for the word-guessing game within the Dynamic Consistency Boundary (DCB) architecture. It adds use cases for starting a game and making guesses, which utilize the DCB application service with automatic retry handling for consistency violations. Additionally, it implements read-model views for ongoing and ended games, including MongoDB storage, event-driven updates, and queries, along with a Spring MVC controller that serves the HTML-based game interface.
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 · high confidence
Added Arrow-based Decider DSL
Introduced a new decider implementation in the \dsl/decider-arrow\ module that leverages the Arrow library's \Either\ type for handling command decisions and errors. This addition provides a functional-style API for defining deciders, allowing users to specify initial state, command handling logic, event evolution, and terminal state conditions using Arrow's functional constructs.
dsl/decider-arrow · high confidence
Added CloudEvent deserialization component in subscription-based MongoDB projections
A new Spring component, DeserializeCloudEventToDomainEvent, has been added to the subscription-based MongoDB projections example. This component handles the conversion of incoming CloudEvents into domain events using Jackson's ObjectMapper, enabling the projection logic to process cloud event payloads effectively.
example-projection-spring-changedstreamed-mongodb-projections · high confidence
Added EveryN predicate for filtering events at regular intervals
A new stateful predicate, EveryN, has been added to the subscription utilities, allowing users to filter event streams so that only every Nth event is processed. This component, located in the subscription/util/predicates module, implements the standard Java Predicate interface for CloudEvent objects and includes a convenience factory method for matching every event. The package also now carries JSpecify nullness defaults to improve type safety.
subscription/util/predicates · high confidence
Added Hederlig DSL for defining command, query, and subscription handlers
Introduced the Hederlig library, providing a Kotlin DSL for defining event-sourcing modules. Users can now use the \module\ builder to configure features, registering command handlers (with or without IDs), query handlers, and event subscriptions. The DSL includes \CommandContext\ for publishing commands and \QueryContext\ for querying event sequences, along with an initializer interface to wire these handlers into the runtime.
occurrent-hederlig · high confidence
Added Kotlin extension functions for blocking EventStore queries and streams
Developers using the blocking EventStore API in Kotlin can now use new extension functions to retrieve query results as a List or a Sequence, and convert event streams into Sequences. The \queryForList\ and \queryForSequence\ functions on \EventStoreQueries\ provide convenient ways to materialize query results, while \eventSequence()\ on \EventStream\ allows seamless conversion of event streams to Kotlin Sequences, improving ergonomics for Kotlin users.
eventstore/api/blocking/src/main/kotlin · high confidence
Added Kotlin extension functions for nullable access and simplified execution
The retry module now includes Kotlin extension functions to improve usability for Kotlin developers. \AfterRetryInfoExtensions\ and \ErrorInfoExtensions\ provide nullable properties (\retryAttemptException\ and \nextBackoff\) that unwrap Optional-returning methods into direct nullable types, simplifying error and backoff handling. Additionally, \RetryStrategyExtensions\ introduces an \exec\ function that allows executing retry strategies with Kotlin lambdas directly, avoiding the need to explicitly wrap code in a Java \Supplier\ when expecting a return value.
common/retry/src/main/kotlin · high confidence
Added Mastermind domain model for the Kotlin decider example
The Kotlin decider example now includes a complete domain model for the Mastermind game. This adds the core domain types (Commands, Events, State, and Model entities like SecretCode and Guess) and implements the game logic as a decider, handling game start, guess submission, feedback calculation, and win/loss conditions.
example-mastermind-decider-model-kotlin · high confidence
Added MongoDB position backfill migration tool
A new \PositionBackfill\ utility has been added to the \occurrent-eventstore-mongodb-position-backfill\ module to retroactively assign global positions to existing events in a MongoDB event store. This allows users to enable stream position tracking on stores that were created before the \position\ extension existed. The tool processes events in batches, supports checkpointing for safe interruption and resumption, and is idempotent, ensuring that only events missing a position are updated.
occurrent-eventstore-mongodb-position-backfill · high confidence
Added OccurrentMongoFlush testing extension
A new JUnit 5 extension, OccurrentMongoFlush, is available to safely clear MongoDB state between tests. It deletes documents from collections while preserving indexes and collections, avoiding the issues caused by dropping the database (such as invalidating change streams or destroying unique indexes). It is designed to be composed with subscription extensions to ensure proper ordering.
occurrent-testing-mongodb · high confidence
Added RFC 3339 time formatting utilities with fixed-width support
The common/time module now includes an internal RFC3339 utility class providing two DateTimeFormatters: a standard flexible formatter and a fixed-width formatter that always outputs exactly 9 digits for fractional seconds. This fixed-width format ensures that stored time strings sort chronologically when compared as byte sequences, which is critical for correct ordering in string-based storage systems like MongoDB. A corresponding test suite validates the parsing of various RFC 3339 date-time representations.
common/time · high confidence
Added Rock-Paper-Scissors decider model example
This change introduces a new example domain model for a Rock-Paper-Scissors game within the \example/domain/rps/decider-model\ module. It defines the core domain logic using the Occurrent decider pattern, including state transitions (from game initiation through player gestures to game end), command definitions (\InitiateNewGame\, \MakeHandGesture\), and event definitions (\NewGameInitiated\, \GameWon\, etc.). The implementation enforces specific business rules, such as preventing the first player from making a second gesture and ensuring only the two participating players (including the initiator) can join the game. Comprehensive unit tests are included to verify these rules and game flow.
example-rps-decider-model, example/domain/rps/decider-model · high confidence
Added Spring Boot example for Uno with blocking event store
This change introduces a new Spring Boot example application for the Uno domain, demonstrating a blocking event store implementation using MongoDB and Redis. The example includes a bootstrap configuration that wires up the SpringMongoEventStore, SpringRedisCheckpointStorage, and DurableSubscriptionModel, along with a generic application service and retry logic. It features a subscription that tracks game progress by counting card plays and stores this state in Redis, and a component that automatically plays a sample game of Uno on application startup to demonstrate the flow.
example/domain/uno/mongodb/spring/blocking · high confidence
Added Spring event listener example for domain events
The example module now includes a new Java component that demonstrates how to listen for and handle domain events (NameDefined and NameWasChanged) using Spring's @EventListener annotation. This file provides a concrete usage pattern for integrating the library's event system with Spring applications.
example-forwarder-mongodb-subscription-to-spring-event · high confidence
Added Uno domain model and event-sourced implementation
This change introduces the core domain model for the Uno card game example within the \example-uno-model\ module. It defines the fundamental data structures for the game, including \Card\ types (Digit, KickBack, Skip), \Color\, \Direction\, and game state transitions (\NotStarted\, \Started\). It also establishes the event schema (\GameStarted\, \CardPlayed\, \PlayerPlayedAtWrongTurn\, \PlayerPlayedWrongCard\, \DirectionChanged\) used for event sourcing. The module includes the \Uno\ object containing the business logic for starting the game and processing moves, along with a \ProgressTracker\ for console-based game progress visualization.
example-uno-model · high confidence
Added Uno game event serialization to CloudEvents
The Uno game domain now includes a new \UnoCloudEventConverter\ that serializes game events (such as GameStarted, CardPlayed, and DirectionChanged) into CloudEvents format for storage in MongoDB. This converter handles the mapping between internal domain data structures and JSON payloads using Jackson, ensuring that event types and data are correctly preserved when moving between the application and the event store.
example-uno-eventstore-mongodb-common · high confidence
Added closing-the-books snapshot example
The example/snapshot/closing-the-books module now includes a demo and tests for two snapshot strategies: a technical snapshot that captures state every N events to optimize replay, and a 'closing the books' policy that snapshots the terminal state when books are closed, allowing the closing balance to be carried forward as an opening balance in the next period while archiving the old event stream.
example/snapshot/closing-the-books · high confidence
Added course management use cases for defining and canceling courses
The course management feature now exposes two new application-level functions, \defineCourse\ and \cancelCourse\, allowing users to create new courses with a title and capacity, or cancel existing ones. These functions act as the write-side interface, executing the corresponding \DefineCourse\ and \CancelCourse\ commands against the course DCB decider.
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/coursemanagement/usecases · high confidence
Added email notification for game winners
The word guessing game now includes a feature that notifies the winner via email when a game is won. This is implemented in the \SendEmailToWinner\ configuration class, which subscribes to the \GameWasWon\ event and logs the notification details (winner ID and game ID) instead of sending an actual email for simplicity.
example/domain/word-guessing-game/mongodb/spring/blocking/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/blocking/features/emailwinner · high confidence
Added example projection and event model for MongoDB queries
The example module now includes a new event model, WorkoutWasCompleted, which captures workout completion details including the user, activity, and timestamp, along with custom Jackson serializers for date handling. Additionally, a new projection component, MostNumberOfWorkouts, has been added to demonstrate how to query the MongoDB event store using Spring Data aggregation to identify the person with the highest number of completed workouts.
example-projection-spring-adhoc-eventstore-mongodb-queries · high confidence
Added in-memory deadline consumer registry and scheduler
This change introduces the \InMemoryDeadlineConsumerRegistry\ and \InMemoryDeadlineScheduler\ classes, providing an in-memory implementation for managing and executing deadline-based tasks. The registry allows users to register and unregister deadline consumers by category, supports configurable poll intervals and retry strategies, and ensures proper shutdown behavior by interrupting retries when the registry is stopped. The scheduler handles the timing of deadline execution, communicating with the registry via a shared blocking queue. Internal data structures and nullness annotations (JSpecify) are also included to support this functionality.
deadline/inmemory/src/main · high confidence
Added in-memory deadline scheduler implementation
Users can now schedule and manage deadlines using a new in-memory implementation (InMemoryDeadlineScheduler) that leverages a scheduled executor service and a blocking deque for communication with the consumer registry. This component allows for scheduling deadlines by ID and category, canceling them, and requires explicit shutdown handling to cleanly terminate the underlying executor service.
occurrent-deadline-inmemory · high confidence
Added multi-round Rock-Paper-Scissors decider model example
The \example-rps-multiround-decider-model\ module now includes a complete domain model for a multi-round Rock-Paper-Scissors game. This example demonstrates how to implement a decider that manages game state across multiple rounds, supporting commands to initiate a new game with a specified number of rounds (1, 3, or 5) and to show hand gestures. The model defines the necessary commands, events, and state transitions to handle round logic, determine round winners, and track the overall game result until all rounds are completed.
example-rps-multiround-decider-model · high confidence
Added native appointment-scheduling domain model and events
This change introduces the core domain model for the appointment-scheduling example, providing a non-Spring implementation of the cross-boundary decision (DCB) pattern. It adds domain events (AppointmentBooked, AppointmentCancelled, ClinicianRegistered, PatientRegistered, SlotDefined) tagged for cross-entity consistency, and a central Appointment decider that enforces booking rules (clinician/patient registration, slot availability, patient limits) and cancellation logic across multiple consistency boundaries.
example-domain-appointment-scheduling · high confidence
Added position backfill migration for unpositioned events
The event store now includes a migration tool that retroactively assigns global positions to existing events that were written without them. This ensures that all events in the store have a strictly increasing position, allowing consumers to resume processing from a consistent checkpoint even after a crash, and preventing conflicts with new live writes.
eventstore/migration/position-backfill · high confidence
Added sandbox rules for Maven commands
New rules have been added to the \.codex/occurrent-sandbox.rules\ file to explicitly allow specific Maven command patterns, including those for running tests, compiling with test skipping, and cleaning before testing.
.codex · high confidence
Annotation-driven DCB TagGenerator for automatic event tagging
The \AnnotationTagGenerator\ in the \dcb-annotation\ service now allows you to derive Distributed Cloud Bus (DCB) tags from event classes using annotations instead of writing a custom \TagGenerator\. By default, it scans for the \@DcbTag\ annotation on record components, getters, or fields (including Kotlin use-site targets like \@field:\ and \@get:\) and uses the annotation's \value()\ or \key()\ attribute as the tag key. It also supports custom annotation types and explicit key resolvers, caching the reflection-based accessors per event class for performance.
application/service/dcb-annotation · high confidence
Annotation-driven stream ID resolution for commands
The command-dispatch-annotation module now provides an AnnotationStreamIdResolver that automatically derives a command's target stream ID by scanning for the @TargetStreamId annotation (or a custom marker annotation) on a command's record component, getter, or field. This allows users to configure command routing via annotations instead of writing manual command-to-stream-ID mapping functions, with built-in validation that enforces exactly one annotated member and rejects null or blank values.
application/command-dispatch-annotation · high confidence
Blocking Dynamic Consistency Boundary (DCB) application service
The blocking application service layer now supports Dynamic Consistency Boundaries (DCB). This adds the DcbApplicationService interface and its GenericDcbApplicationService implementation, allowing domain decisions to be executed against events selected by a DCB query (DcbCriteria) rather than a single stream. The service handles reading the boundary, converting domain events to CloudEvents, applying tags via a TagGenerator, and appending with a DCB conflict condition. It also supports optional post-append side-effects, per-execute tag generators, and synchronous event dispatching within a transaction.
application/service/blocking/src/main/java/org/occurrent/application/service/blocking/dcb · high confidence
Blocking Event Store API restructured with new interfaces and null-safety
The blocking event store API has been reorganized into distinct interfaces to clarify capabilities: \EventStore\ now composes \ReadEventStream\, \ConditionallyWriteToEventStream\, \UnconditionallyWriteToEventStream\, and \EventStreamExists\ for transactional use cases, while \EventStoreOperations\ handles advanced actions like deleting streams or events and updating specific events, and \EventStoreQueries\ provides filtering, counting, and sorting. The \EventStream\ interface now exposes events as a \Stream\ and includes a \map\ function, and \PositionOrderedReader\ has been added to support reading events by global position with a runtime check (\writesPosition()\) to ensure safety. All interfaces are annotated with \@NullMarked\ from JSpecify to enforce null-safety.
eventstore/api/blocking/src/main/java/org/occurrent/eventstore/api/blocking · high confidence
Blocking catch-up-then-push subscription model with push event observation
The blocking subscription module now includes a \CatchupThenPushSubscriptionModel\ that replays historical events from the event store before handing over to a live external push feed (such as RabbitMQ or Kafka), ensuring new projections are backfilled before consuming live messages. This model is paired with a new \PushSubscriptionModel\ for registering handlers against external push sources and a \PushObserver\ interface that reports routing outcomes (delivered, filtered, unavailable, etc.) for every event, allowing applications to distinguish between configuration errors and intentional handler inaction.
subscription/push/blocking · high confidence
Blocking snapshot DSL for deciders and DCB
This change introduces the blocking snapshot DSL, providing new classes in the \org.occurrent.dsl.snapshot.blocking\ package to enable state snapshots for command handling. It adds \SnapshotDecider\ and \SnapshotDeciderApplicationService\ for stream-based deciders, allowing execution to resume from a snapshot rather than replaying the entire event stream. It also adds \SnapshotDcbDecider\ and \SnapshotDcbDeciderApplicationService\ for the Decider Command Boundary (DCB) path, where snapshots are keyed by the decider's criteria. The module includes \SnapshotStore\ as a storage-neutral interface, \SnapshotPolicies\ for defining when to save (e.g., on terminal state), and internal support classes like \SnapshotStoreSupport\ for best-effort saving. This allows users to optimize performance by reducing replay overhead for aggregates with long event histories.
dsl/snapshot-dsl/blocking/src/main · high confidence
Configurable batch size and max await time for native MongoDB subscriptions
The NativeMongoSubscriptionModel now exposes configuration options for the underlying MongoDB change stream, allowing users to set the batchSize and maxAwaitTime. This enables tuning of throughput and delivery latency for high-volume scenarios, such as outbox processing, by reducing round-trips or lowering idle cursor chatter. Additionally, a new configuration flag allows automatic restart of subscriptions when the change stream history is lost (oplog drop), which is disabled by default to prevent potential event loss.
subscription/mongodb/native/blocking · high confidence
Course enrollment now enforces cross-entity invariants via a Dynamic Consistency Boundary
The course-enrollment example now implements a cross-boundary decider that simultaneously enforces course capacity limits and per-student enrollment caps. This change introduces a new event model (StudentEnrolledInCourse, StudentUnenrolledFromCourse) and a dedicated decider that reads from both the course and student boundaries to ensure data consistency without sagas. It also adds explicit exception handling for scenarios like cancelled courses, deregistered students, and enrollment limits, along with application service functions to trigger enrollment and unenrollment actions. Also in this area: Automatic unenrollment of deregistered students from all courses; Server-rendered enrollment dashboard with live activity feed.
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/enrollment · high confidence
Decider DSL now supports multiple commands and composed state
The Decider DSL has been updated to allow processing multiple commands in a single decision step via varargs and list-based methods on \decideOnEvents\ and \decideOnState\, returning a new \Decision\ type that bundles the resulting state and events. Additionally, a new \Decider.compose\ capability has been introduced, enabling the combination of multiple deciders into a single unit; this produces a \CompositeState\ record (or typed Pair/Tuple in Kotlin) to hold the individual states of each composed decider, allowing users to manage complex, multi-entity decision logic within a single invocation.
occurrent-decider · high confidence
Experimental JobRunr integration for deadline scheduling and consumption
Users can now use JobRunr as the underlying engine for the deadline subsystem. This change introduces the JobRunrDeadlineScheduler, which schedules deadline events as JobRunr jobs and cancels them by deleting those jobs, and the JobRunrDeadlineConsumerRegistry, which manages the mapping of deadline categories to their respective consumer handlers. This provides an alternative to existing deadline implementations by leveraging JobRunr's job scheduling capabilities.
occurrent-deadline-jobrunr · high confidence
First-class snapshot support for decider and projection state
The snapshot DSL module now provides a dedicated API for accelerating state reconstruction in deciders, projections, and views. Users can define a \SnapshotView\ to fold events into state with explicit schema versioning, allowing stale snapshots to be automatically invalidated when the state shape changes. Snapshot writing is controlled via \SnapshotPolicy\, which supports triggers such as every N events, specific event types, or state predicates. For DCB (Decider-Criteria-Based) boundaries, a new \DcbSnapshotView\ and \DcbSnapshotKeys\ ensure snapshots are keyed deterministically by the selection criteria rather than the decider, preventing misses due to unordered tag/type sets.
dsl/snapshot-dsl/common/src/main/java · high confidence
First-class snapshot support with schema versioning and stream-reset safety
The snapshot DSL now provides a dedicated API for caching and resuming event-stream state. A new \Snapshot\ record stores the folded state along with a \schemaVersion\ and stream version, allowing the system to detect when a state shape has changed and fall back to a full replay. The \SnapshotDecision\ record exposes the outcome of event processing to a \SnapshotPolicy\ for deciding when to persist new snapshots. Internally, \SnapshotSupport\ implements the core logic for loading and resuming state, introducing a critical safety check: when a stream is reset (truncated), snapshots with a version exceeding the current stream head are discarded to prevent folding onto stale or non-existent state.
occurrent-snapshot-dsl-common · high confidence
First-class snapshot view support with DCB read boundaries
Users can now build type-safe snapshot views using the new \snapshotView\ and \dcbSnapshotView\ DSL functions. These functions allow registering per-event-type handlers (including metadata-aware folds) and configuring schema versions. The \dcbSnapshotView\ variant specifically supports setting a DCB read boundary via tags or explicit criteria, enabling efficient snapshot reconstruction filtered by specific event streams or tags.
dsl/snapshot-dsl/common/src/main/kotlin · high confidence
Global position catch-up example for cross-stream event ordering
The global-position-catchup example now demonstrates how to rebuild a read model by replaying domain events in a single, unified global position order across all streams, rather than processing them stream-by-stream. The included NameProjection and its tests show how to read events from an event store using position-based queries (afterPosition, readInPositionOrder) to maintain cross-stream write order, and how stores that opt out of stream position tracking correctly reject these position-based operations.
example/projection/global-position-catchup · high confidence
Initial course-enrollment domain skeleton added
The course-enrollment example now includes its foundational domain structure, introducing common types such as DomainEvent and DomainCommand, along with specific identifiers like CourseId and StudentId. A Spring Boot bootstrap class is provided to enable the Occurrent MongoDB starter and configure the necessary type mappers, establishing the baseline for the write-side implementation.
example/domain/course-enrollment/src/main/kotlin · high confidence
Initial experimental support for deadlines using JobRunr
This change introduces the initial experimental implementation of deadline functionality backed by the JobRunr library. It adds the \DeadlineJobRequest\ class to handle job data storage and registration, along with nullness annotations (JSpecify) for improved type safety across the \org.occurrent.deadline.jobrunr\ packages.
deadline/jobrunr/src/main · high confidence
Initial release of in-memory event store implementation
This change introduces the InMemoryEventStore, a new in-memory implementation of the EventStore interface designed primarily for testing and demonstration purposes. It supports core event store operations including writing events with conditions, reading streams, and querying events. The implementation includes support for Dynamic Consistency Boundaries (DCB), listener subscriptions, and filtering on payload data fields (when a DataFieldReader is provided). It also handles global positioning for both stream and DCB events, ensures duplicate event rejection, and provides methods to configure stream positioning behavior.
occurrent-eventstore-inmemory · high confidence
Initial release of the Word Guessing Game example
This change introduces the Word Guessing Game example application, providing a complete reference implementation for building event-sourced applications with Spring Boot and MongoDB. The example demonstrates key architectural patterns including a feature-based structure, durable and catch-up subscription models for event processing, and CloudEvent conversion for domain events. It includes a Spring Boot bootstrap configuration that wires up the event store, checkpoint storage, and application services, along with a simple web interface that redirects to the game listing page.
example/domain/word-guessing-game/mongodb/spring/blocking · high confidence
Initial word-guessing game domain model and logic
This change introduces the core domain model for the word-guessing game example, defining the event-driven state machine and read models. It adds \GameEvent\ types (such as \GameWasStarted\, \PlayerGuessedTheRightWord\, and \GameWasWon\) to track game progress, alongside read models like \OngoingGameReadModel\ and \EndedGameOverview\ for querying game status. The write model implements the game logic in \GameLogic.kt\, handling state transitions from \NotStarted\ to \Ongoing\ and \Ended\, while \PointAwarding.kt\ enforces rules for awarding points based on guess count and preventing self-awarding. Additionally, \WordHintCharacterRevelation.kt\ provides the logic for revealing hint characters, and \GameWriteModel.kt\ defines value objects like \Word\ with validation for length and character composition.
example-domain-word-guessing-game-model · high confidence
Introduce DCB command dispatchers for deciders and invocations
The application/command-dispatch-dcb module now provides ready-made CommandDispatcher implementations for the Domain Command Boundary (DCB) architecture. The new DcbCommandDispatchers.decider method allows a DcbDecider to issue domain functions directly, deriving the read boundary once per batch to ensure consecutive commands targeting the same boundary are folded into a single atomic append. Additionally, DcbCommandDispatchers.invocation supports commands that carry their own handling logic and specific tag generators, enabling reactions to append events with precise tagging while avoiding batch folding issues.
application/command-dispatch-dcb · high confidence
Introduce DcbDecider to couple decision logic with DCB read boundaries and event tags
The DCB DSL now provides a DcbDecider type that bundles a Decider with its specific DcbCriteria (read boundary) and TagGenerator (event tags), keeping feature-scoped query and tagging logic alongside the decision logic. This change introduces Java and Kotlin APIs to build, adapt, and compose these coupled deciders, and adds a DcbCriteriaBuilder that expands declared event types (sealed hierarchies and Kotlin enums) into CloudEvent type strings while refusing types that cannot be fully enumerated. A DcbEventMetadata wrapper and Kotlin extensions expose global event position and DCB tags, and a DcbDomainEventStream record captures the result of a DCB read including its consistency token.
dsl/dcb-dsl/common · high confidence
Introduce DcbEvent wrapper for reactive DCB subscriptions
The reactor module now delivers domain events wrapped in a new DcbEvent record that pairs the converted event with its DcbEventMetadata. This change enables reactive DCB subscriptions to access both the event payload and its associated metadata, providing a consistent structure for event handling in the reactive stack.
occurrent-dcb-dsl-reactor · high confidence
Introduce Dynamic Consistency Boundary (DCB) API for optimistic concurrency
This change adds the core API for Dynamic Consistency Boundaries (DCB) in the \eventstore/api/dcb\ module, enabling optimistic concurrency control over shared CloudEvent storage. It introduces \DcbEventStore\ for reading and appending events based on criteria (types and tags) rather than stream IDs, and \DcbAppendCondition\ to enforce conflict checks using either whole-store locks or scoped consistency tokens derived from prior reads (\DcbConsistencyToken\). The API includes \DcbCriteria\ for defining match rules, \DcbReadOptions\ for pagination and direction, and \DcbCloudEvents\ for managing DCB metadata in CloudEvent extensions. Storage placement is handled by \DcbStreamIdGenerator\ and its default implementation \PartitionedDcbStreamIdGenerator\, which hashes boundary tags to distribute events across partitions.
eventstore/api/dcb/src/main/java/org/occurrent/eventstore/api/dcb · high confidence
Introduce FlowSaga DSL for linear event-driven process management
A new FlowSaga DSL is available for defining linear, declarative saga flows composed of named steps, branches, and timeouts. The implementation provides a builder API to configure start events, correlation logic, and step transitions, while introducing configurable history and step windows to bound the persisted state of long-running instances. Users can define step conditions that trigger on specific event types or aggregated event windows, with support for timeouts and guarded branches, compiling down to the core Saga executor for reliable state management.
dsl/saga-dsl/common/src/main/java/org/occurrent/dsl/saga/flow · high confidence
Introduce GenericApplicationService with synchronous subscriptions and retry logic
The blocking application service now includes a new GenericApplicationService implementation that supports configurable retry strategies (defaulting to 5 attempts with exponential backoff for write conflicts) and optional synchronous event subscriptions. When synchronous subscriptions are enabled via the builder, event dispatch occurs atomically within the same transaction as the write, ensuring handlers receive enriched events (including stream version and global position) without requiring separate transactional overhead for non-synchronous use cases.
application/service/blocking/src/main/java/org/occurrent/application/service/blocking/generic · high confidence
Introduce Kotlin DSL for reactive stream subscriptions
This change adds a new Kotlin DSL for creating reactive subscriptions in the reactor module. It introduces \streamSubscriptions\ and \subscriptions\ entry points, allowing users to define subscriptions using idiomatic Kotlin syntax with reified type parameters for event types. The DSL automatically derives default subscription IDs from CloudEvent types and returns a \Subscription\ object immediately, exposing a \waitUntilStarted\ Mono for asynchronous readiness checks. Additionally, Kotlin-idiomatic extension functions \capability()\ and \hasCapability\ are provided for \SubscriptionModelCapability\ to simplify capability lookups without dealing with Java's Optional.
dsl/subscription-dsl/reactor/src/main · high confidence
Introduce Kotlin Projection DSL for building read models
Adds a new type-safe Kotlin DSL for defining projections, allowing users to build capability-agnostic read models using builder functions like \projection\, \dcbProjection\, and \singletonProjection\. This new API supports per-event-type handler blocks, instance ID derivation from events or metadata, and optional DCB (Data-Centric Boundary) filtering via tags or criteria, providing a more idiomatic Kotlin alternative to the existing Java-based projection builders.
dsl/projection-dsl/common/src/main/kotlin · high confidence
Introduce RabbitMQ domain event source factory and auto-configuration
This change adds the Spring Boot auto-configuration and factory components for consuming domain events from RabbitMQ queues. It introduces the \RabbitMqDomainEventSourceFactory\ interface and its \DefaultRabbitMqDomainEventSourceFactory\ implementation, which build domain event sources pre-seeded with connection details, resolver, and source-specific properties (such as topology declaration, retry strategies, and parking destinations). The \RabbitMqDomainBrokerConfiguration\ class registers the necessary beans, including a lazy-loaded \RabbitMqDomainEventSink\ that intelligently resolves \CloudEventSink\ ambiguities when multiple broker starters are present, ensuring that application-defined sinks take precedence over starter fallbacks.
broker/rabbitmq/spring-boot-starter/src/main/java/org/occurrent/springboot/broker/rabbitmq/blocking/domain · high confidence
Introduce Spring MongoDB lease-based competing consumer strategy
A new Spring-specific implementation of the competing consumer strategy has been added, allowing MongoDB-backed event subscriptions to coordinate access using a lease mechanism. This strategy ensures that only one subscriber receives events for a given subscription at a time by managing locks in a MongoDB collection, with a background thread handling periodic lease updates. It integrates with Spring's lifecycle via {@code @PreDestroy} for clean shutdown and delegates core logic to a shared support class, while also implementing fencing tokens to handle connection losses and clock skew scenarios.
occurrent-subscription-mongodb-spring-blocking-competing-consumer-strategy · high confidence
Introduce TagGenerator for DCB tag derivation
The application service now includes a new TagGenerator interface that allows deriving Dynamic Consistency Boundary (DCB) tags from domain events before they are stored as CloudEvents. This interface supports composing multiple taggers to produce a union of tags, enabling more flexible and modular tag assignment for DCB queries.
application/service/common/src/main/java/org/occurrent/application/service/dcb · high confidence
Introduce blocking DSL module for command dispatching and subscriptions
The blocking DSL module now provides a structured way to define command dispatchers and subscriptions. Users can create a module using the \module\ function, which accepts a \CloudEventConverter\ and a builder block. Inside the builder, commands can be registered via \commands\, supporting both simple dispatch functions and more complex \ApplicationServiceCommandDispatcher\ instances that allow for stream-based execution. Additionally, subscriptions can be configured using the \subscriptions\ function, integrating with the existing subscription DSL to handle event processing within the blocking context.
dsl/module-dsl/blocking/src/main · high confidence
Introduce blocking Event Model DSL for defining command and event handling
Adds a new \eventModel\ DSL entry point in the blocking module, allowing users to define modules with swimlanes, slices, and command handlers. The DSL provides a structured way to register command dispatchers and wire up event views (currently with placeholder implementations for sync/async updates), enabling the configuration of event-sourced application logic through a fluent Kotlin API.
occurrent-module-dsl-blocking · high confidence
Introduce blocking Kafka broker source and sink with CloudEvents binary binding
This change adds the blocking Kafka broker implementation, introducing KafkaCloudEventSource for consuming events and KafkaCloudEventSink for publishing them, along with supporting classes like KafkaCloudEventMapper, KafkaDeliveryFailureAction, and destination resolvers. The source rebuilds CloudEvents from Kafka records using the cloudevents-kafka binary reader, correcting type mapping for streamversion and position extensions and preserving empty data payloads. The sink publishes events with at-least-once semantics, enforcing acks=all and providing configurable retry and acknowledgement timeout behavior. The source handles delivery failures via REDELIVER or PARK policies, manages partition-level failure isolation, and integrates with push subscription models for event processing.
broker/kafka/blocking/src/main/java/org/occurrent/broker/kafka/blocking · high confidence
Introduce blocking Saga DSL with configurable redelivery detection and instance quarantine
The blocking Saga DSL now includes a \SagaRunner\ that manages event-driven saga instances with configurable redelivery detection and instance quarantine. By default, the runner requires events to carry stream metadata (stream ID/version or position) to distinguish redeliveries; if metadata is missing, it throws a \SagaRedeliveryDetectionException\ unless configured for \BEST\_EFFORT\ mode. The runner also supports instance quarantine: if a saga instance fails repeatedly within a configurable time window (\quarantineAfter\, default 5 minutes), it is marked as quarantined to prevent it from blocking other instances. Additionally, the runner supports lease-gated timer polling for multi-instance deployments via \CompetingConsumerStrategy\, ensuring only one instance polls for due timers at a time.
dsl/saga-dsl/blocking/src/main/java · high confidence
Introduce blocking broker API foundation module
Added a new foundation module for the blocking broker API, introducing core abstractions for event forwarding and routing. This includes CloudEventForwarder and DomainEventForwarder to drive stored events to sinks with at-least-once delivery guarantees, along with CloudEventSink and DomainEventSink interfaces for publishing. The module also defines DestinationResolver for transport-agnostic routing, EventTypeNarrowing to derive event types from filters, EventDestination as a transport-specific marker, and DeliveryFailurePolicy to configure redelivery or parking behavior for failed messages.
broker/api/blocking/src/main · high confidence
Introduce domain-level Kafka event source and sink
Added KafkaDomainEventSource and KafkaDomainEventSink to the blocking Kafka broker module. The source feeds Kafka topics into a DomainEventFeed, handling CloudEvent reconstruction, delivery outcomes, and permanent stop conditions for unreadable filters. The sink converts domain events to CloudEvents and delegates publishing to a configured CloudEventSink, stripping storage-owned extensions to prevent lossy round-trips when used with forwarders.
broker/kafka/blocking/src/main/java/org/occurrent/broker/kafka/blocking/domain · high confidence
Introduce high-level Projection DSL for read models
The projection DSL now provides a new, capability-agnostic way to define read models using the \Projection\ class and its builders (\builder\, \singletonBuilder\). This allows you to define a fold (state transition logic) alongside the event types or filters that feed it, supporting both single-instance projections (like leaderboards) and keyed projections (like user profiles). The DSL also introduces \DcbProjection\ to pair a projection with a DCB criteria for event selection, and \AppliedAppendRecorder\ to handle recording of applied appends during replay, ensuring consistent read-your-writes behavior.
dsl/projection-dsl/common/src/main/java/org/occurrent/dsl/projection · high confidence
Introduce reactive CatchupThenPushSubscriptionModel for backfilling projections
Added a new reactive subscription model that combines a one-time history replay (catch-up) with a live push feed. This allows new or rebuilt projections to be backfilled from the event store before consuming live events from external sources like RabbitMQ or Kafka, ensuring data consistency without manual intervention.
occurrent-subscription-push-reactor · high confidence
Introduce reactive Spring Boot starter for MongoDB
Adds a new Spring Boot starter for reactive MongoDB support, enabling auto-configuration of the reactive event store, subscription models, and projection infrastructure. The starter provides the \@EnableOccurrentReactive\ annotation and \OccurrentReactiveMongoAutoConfiguration\ to wire up \ReactorMongoEventStore\, \ReactorMongoSubscriptionModel\, and \ReactiveMongoAppliedAppendStore\ with sensible defaults. It also includes integration tests to verify correct bean wiring and resolution of application-supplied subscription models.
framework/spring-boot-starter-mongodb-reactive · high confidence
Introduce reactive synchronous subscription model
Adds a new synchronous subscription model for the reactive stack, allowing event handlers to be composed directly into the writer's reactive chain rather than driven asynchronously from a change stream. This model dispatches events to matching handlers sequentially in registration order, ensuring that a handler error propagates back to the caller (potentially rolling back a reactive transaction) and, outside a transaction, prevents a failing handler from stranding subsequent handlers. It also supports filtering on fields inside the event payload when a data field reader is provided, and includes conformance tests to verify its behavior against the standard subscription model contracts.
subscription/synchronous/reactor · high confidence
Introduce shared ExecuteFilter for application service event filtering
Added a new \ExecuteFilter\ interface in the application service common module that allows users to define fluent filters based on domain event classes (e.g., \type(MyEvent.class)\, \includeTypes\, \excludeTypes\). This filter resolves domain event types to CloudEvent types at execution time via a \CloudEventTypeGetter\, ensuring that inclusive filters refuse types they cannot fully expand (such as Kotlin enums with constant bodies) while exclusive filters safely widen to all found subtypes. The implementation is shared by both blocking and reactive application services and includes null-safety annotations via JSpecify.
application/service/common/src/main/java/org/occurrent/application/service · high confidence
Introduce synchronous, in-process subscription model
A new SynchronousSubscriptionModel is added to the subscription/synchronous/blocking module, allowing event handlers to run synchronously on the calling thread during the write operation rather than asynchronously from a change stream. This model supports payload filtering via a DataFieldReader (e.g., Jackson-backed) and handles transactional semantics by stopping dispatch on the first handler exception when inside a transaction, while ensuring all handlers are attempted and failures are aggregated when outside a transaction to prevent stranding subsequent handlers.
subscription/synchronous/blocking · high confidence
Introduce view-dsl module with MaterializedView and ReplayAware capabilities
The new view-dsl module provides a structured API for building materialized views, centered on the MaterializedView interface which combines a View definition with a ViewStateRepository to handle event updates. This release adds support for EventMetadata in view folds, allowing views to be keyed by metadata such as stream IDs, and introduces the ReplayAware interface to enable views to buffer and coalesce state writes during catch-up replays for improved performance. The module also includes the ViewStateRepository interface with batched read/write seams (findAllById, saveAll) to allow implementations to optimize store round trips.
dsl/view-dsl/src/main/java/org/occurrent/dsl/view · high confidence
Introduces AI coding agent guidance and architecture decision record structure
The repository now includes AGENTS.md, a guide for AI coding agents and human contributors covering module layout, issue claiming protocols, and documentation standards, alongside a new .adr-dir file that establishes doc/architecture/decisions as the canonical location for Architecture Decision Records.
(repo-wide) · high confidence
Introduces Hederlig, an experimental Kotlin DSL for defining CQRS modules
Adds the new \library/hederlig\ module, providing a Kotlin DSL for defining command, query, and subscription handlers within a modular structure. The library includes a \module\ builder for configuring features, interfaces for \CommandContext\ and \QueryContext\, and an \OccurrentHederligModuleInitializer\ that wires these definitions to the existing Occurrent infrastructure (ApplicationService, Subscriptions, and DomainEventQueries). This allows users to define domain logic using a declarative DSL style, with support for delayed command publishing and sequence-based queries.
library/hederlig · high confidence
Introduces Kotlin DSL for flow-based sagas with reified event extensions
Adds a new Kotlin DSL for defining event-driven process managers (sagas) via the \saga { }\ builder in \SagaFlowExtensions.kt\, featuring linear step definitions, explicit correlation (\correlate\, \correlateAll\), and step continuations (\next\, \end\, \transitionTo\). Introduces \ReceivedEventsExtensions.kt\ to provide reified Kotlin extensions (\initiating\, \first\, \any\, \none\, \all\, \count\) for querying received events without explicit class arguments. Includes configuration for event history retention via \historyWindow\ and \stepWindow\.
dsl/saga-dsl/common/src/main/kotlin/org/occurrent/dsl/saga/flow · high confidence
Introduces RabbitMQ blocking broker with CloudEvents support and robust publish/consume semantics
This change adds the RabbitMQ blocking broker implementation, providing a complete CloudEvents sink and source for RabbitMQ. The sink ensures at-least-once delivery by using publisher confirms and mandatory routing, with automatic channel retirement on timeouts and configurable retry strategies for transient failures. The source consumes messages from a RabbitMQ queue, mapping them to CloudEvents and integrating with the push subscription model, handling acknowledgements, deferred deliveries, and permanent failures according to the configured delivery policy. A shared mapper handles the serialization and deserialization of CloudEvents to and from AMQP properties, and a failure classifier distinguishes between transient and permanent broker errors to guide retry behavior.
broker/rabbitmq/blocking/src/main/java/org/occurrent/broker/rabbitmq/blocking · high confidence
Introduces blocking API for scheduling and managing deadlines
This change adds the blocking API for the deadline feature, providing the core interfaces and types needed to schedule, cancel, and consume deadlines. It introduces the \Deadline\ sealed interface to represent future dates/times, along with factory methods for creating deadlines from various temporal types. The \DeadlineScheduler\ interface allows users to schedule and cancel deadlines by ID, category, and associated data. Additionally, the \DeadlineConsumer\ functional interface and \DeadlineConsumerRegistry\ enable registering callbacks that are invoked when specific deadline categories occur, supporting type-safe data handling and consumer composition.
deadline/api/blocking · high confidence
Introduces dedicated delivery worker and destination model for RabbitMQ blocking broker
This change adds the RabbitMqDeliveryWorker and RabbitMqDestination classes to the blocking broker module. The new delivery worker ensures that message handling runs on a dedicated thread per bridge, preventing a single slow handler from blocking the RabbitMQ client's shared consumer thread and impacting other bridges on the same connection. The RabbitMqDestination record provides a structured way to define exchange, routing key, and headers, including validation for RabbitMQ's 255-byte shortstr limit and reserved header prefixes.
occurrent-broker-rabbitmq-blocking · high confidence
Introduces reactive Java DSL for Domain Command Bus operations
Adds a new set of Java classes in the \org.occurrent.dsl.dcb.reactor\ package to support reactive DCB workflows. \DcbDeciderApplicationService\ provides a facade for executing commands and deciders, returning results as Reactor \Mono\ streams. \DcbDomainEventQueries\ enables querying DCB events with support for criteria-based filtering and position tracking. \DcbSubscriptions\ allows subscribing to live DCB event streams, with options for named, lifecycle-managed subscriptions and metadata delivery. \DcbEvent\ is a new record type that pairs domain events with their DCB metadata for subscription handlers.
dsl/dcb-dsl/reactor/src/main/java · high confidence
Introduces reactive snapshot views with explicit read and refresh operations
This change adds the \ReactiveSnapshotViews\ facade and its backing \InMemoryReactiveSnapshotStore\ to the Reactor DSL, enabling on-demand, decider-free access to snapshot view state. Users can now call \readState\ to perform a pure read that resumes a view from its stored snapshot and folds subsequent events, or \refresh\ to explicitly rebuild and persist the latest snapshot. This separates snapshot maintenance from command processing, ensuring that snapshotting is never a hidden side effect of a read operation.
occurrent-snapshot-dsl-reactor · high confidence
Introduces server-side filtering for MongoDB change stream subscriptions
The MongoDB subscription module now applies filters directly to the MongoDB change stream pipeline using Spring Data's ChangeStreamOptions. A new internal component, ApplyFilterToChangeStreamOptionsBuilder, translates various subscription filter types (StreamSubscriptionFilter, AgnosticSubscriptionFilter, DcbSubscriptionFilter, and raw MongoJson/Bson specifications) into MongoDB aggregation match stages. This enables the database to filter events server-side before they are processed by the application, improving efficiency for capability-agnostic and stream-based subscriptions.
subscription/mongodb/spring/common · high confidence
Jackson 3 CloudEvent converter with configurable time precision
The CloudEvent converter now provides a Jackson 3-native implementation (JacksonCloudEventConverter) that uses tools.jackson.databind.ObjectMapper for serialization. This new converter includes a builder API allowing users to configure the event ID, type, subject, and content type, and introduces a timePrecision option to truncate event timestamps to a specific ChronoUnit (e.g., milliseconds), which is useful when the event store does not support sub-millisecond precision. Kotlin users can utilize the provided jacksonCloudEventConverter extension function for idiomatic construction. The core support logic in CloudEventConverterSupport handles the actual conversion and time truncation, while null-safety is enforced via JSpecify annotations across the internal and jackson3 packages.
application/cloudevent-converter/jackson3 · high confidence
Jackson-based CloudEvent converter for domain events
This location introduces the Jackson implementation of the CloudEvent converter, allowing domain events to be serialized to and from CloudEvents using JSON. It provides the \JacksonCloudEventConverter\ class and a \DomainEventPackageNameResolver\ interface for Java users, along with Kotlin extension functions (\jacksonCloudEventConverter\) to simplify builder configuration. The converter uses a \CloudEventTypeMapper\ to determine the CloudEvent type and supports custom mappers for event ID, time, and subject.
application/cloudevent-converter/jackson/src/main · high confidence
Kotlin DSL extensions for DCB execution and side-effects
New Kotlin extension functions have been added to the DCB application service to improve the developer experience. The \executeOrNull\ functions provide a Kotlin-friendly alternative to the Java API by returning a nullable \DcbAppendResult\ instead of an \Optional\, simplifying null-checks for no-op commands. Additionally, \dcbExecuteOptions\ and \dcbSideEffect\ helpers allow Kotlin users to easily configure and chain typed side-effects that are invoked after events are successfully appended, mirroring the capabilities available in the Java API.
application/service/blocking/src/main/kotlin/org/occurrent/application/service/blocking/dcb · high confidence
Kotlin DSL extensions for blocking DCB deciders, queries, and subscriptions
This change introduces Kotlin-specific extension functions in the blocking DCB DSL to improve ergonomics for developers using the Dynamic Consistency Boundary. For deciders, new \execute\ and \executeAndReturn\*\ overloads allow passing a \DcbDecider\ directly, automatically deriving the read boundary, handling event type widening, and routing decider-specific tags via \DcbExecuteOptions\. For querying, convenience methods like \queryForList\, \queryForSequence\, and tag-based shortcuts replace the need to manually convert Java Streams or chain builder calls. For subscriptions, idiomatic \subscribeDcb\ and \subscribeDcbWithMetadata\ functions wrap the underlying \DcbSubscriptions\ class, providing sensible defaults (such as \waitUntilStarted=true\) and simplified callbacks.
dsl/dcb-dsl/blocking/src/main/kotlin · high confidence
Kotlin extension functions for blocking DomainEventQueries
Added Kotlin extension functions to the blocking query DSL, providing idiomatic \queryForSequence\, \queryForList\, and \queryOne\ methods for \DomainEventQueries\. These extensions simplify querying by returning Kotlin-native \Sequence\ and \List\ types instead of Java streams, and support filtering, sorting, pagination (skip/limit), and type-based queries with default unsorted ordering.
dsl/query-dsl/blocking/src/main/kotlin · high confidence
Kotlin helpers for typed ExecuteFilters and ExecuteOptions
The blocking application service now provides Kotlin-specific extension functions and an \ExecuteFilters\ object to simplify building typed execute filters and options. Developers can use reified type parameters to create filters for specific event types (\ExecuteFilters.type\<MyEvent\>()\) or include/exclude multiple types without casting. Additionally, \ExecuteOptions\ helpers allow chaining typed side-effect lambdas (supporting up to eight distinct event types) and a new \sideEffectOnList\ function that processes all matching events in a single batch, improving type safety and reducing boilerplate in Kotlin codebases.
application/service/blocking/src/main/kotlin/org/occurrent/application/service/blocking · high confidence
Kotlin subscription DSL now supports waitUntilStarted configuration and capability lookups
The blocking subscription DSL in Kotlin now allows users to control whether a subscription waits for the underlying subscription model to start before returning, via a new \waitUntilStarted\ parameter (defaulting to \true\) on the \subscribe\ methods. Additionally, a new \SubscriptionModelCapabilities.kt\ file provides Kotlin-idiomatic extension functions (\capability()\ and \hasCapability()\) to check for and retrieve subscription model capabilities, replacing the need to handle Java \Optional\ types directly.
dsl/subscription-dsl/blocking/src/main · high confidence
Manual start support for reactive push projections
Applications using reactive projections with a push source can now defer their startup and catch-up until explicitly triggered, rather than running automatically at boot. This is controlled by setting \occurrent.subscription.mode=manual\, which withholds the projection's initialization work. The new \ManualStartPushSources\ registry allows the application to start individual projections via \start(String)\ or all withheld projections via \startAll()\ once the system is ready. The \OccurrentReactiveAnnotationBeanPostProcessor\ and \ProjectionAnnotationRegistrar\ coordinate this by registering the withheld work and managing the lifecycle of the push subscription models and background catch-ups.
occurrent-reactor-spring-boot-autoconfigure · high confidence
MongoDB Reactive Snapshot Store Provider Implementation
The MongoDB Reactive Spring Boot starter now includes a concrete implementation for providing reactive snapshot stores. This change introduces MongoReactiveSnapshotStoreProvider, which enables the framework to automatically create and manage snapshot data in MongoDB collections (named occurrent-snapshot-\<id\>) when using reactive Spring Data MongoDB, ensuring that snapshots are stored efficiently without creating unnecessary resources.
occurrent-mongodb-reactive-spring-boot-starter · high confidence
Native MongoDB blocking competing consumer strategy implementation
A new \NativeMongoLeaseCompetingConsumerStrategy\ is introduced for the native Java MongoDB driver, enabling lease-based competing consumer patterns where only one subscriber receives events for a specific subscription. The strategy manages locks via a background thread that periodically refreshes the lease, with a default lease time of 20 seconds and exponential backoff retries. It supports registering, unregistering, and releasing consumers, checking lock status, and adding listeners. Notably, the builder's \clock\ method is now a no-op because lease expiry is judged against the database's own clock to handle clock skew between nodes, ensuring consistent lock behavior across distributed nodes.
occurrent-subscription-mongodb-native-blocking-competing-consumer-strategy · high confidence
Native MongoDB event store now supports external transaction binding and configurable query options
The native MongoDB event store now allows writes and DCB appends to join an externally managed MongoDB transaction via a new thread-bound \ClientSessionHolder\, ensuring atomic commits with synchronous subscription handlers. Additionally, the \EventStoreConfig\ exposes a \queryOptions\ builder method, enabling users to customize MongoDB query settings (such as cursor timeout) for read operations.
eventstore/mongodb/native/src/main · high confidence
Native MongoDB transaction executor for synchronous subscriptions
Non-Spring applications using the native MongoDB Java driver can now execute event writes and synchronous subscription handlers within the same database transaction. The new NativeMongoTransactionExecutor binds a MongoDB ClientSession to the current thread, ensuring that if a synchronous handler throws, the event write is rolled back, and handlers can see uncommitted events written in the same unit of work.
application/service/transaction-mongodb-native · high confidence
New APIs for push subscription catch-up status and applied append recording
The autoconfigure module introduces \PushCatchupStatus\ and \PushCatchupStatusImpl\ to expose the catch-up state of \source = PUSH\ projections and sagas, allowing applications to check readiness via health indicators or probes. It also adds \AppliedAppendRecordingRegistry\ to manage the polling schedule for projections that opt in to recording applied appends, ensuring consistent pacing across blocking and reactor stacks.
occurrent-spring-boot-autoconfigure · high confidence
New CatchupThenPushSubscriptionModel for backfilling projections from push sources
Added a new CatchupThenPushSubscriptionModel that enables projections fed by external push sources (like RabbitMQ or Kafka) to first replay historical events from the event store before switching to the live push feed. This ensures new or rebuilt projections are fully backfilled before consuming live events, addressing the limitation that brokers alone cannot provide historical context. The model handles the handover, deduplication, and buffering during the transition, and supports introspection and checkpointing for the one-time catch-up phase.
occurrent-subscription-push-blocking · high confidence
New CloudEvent type mapping API and Kotlin extensions
The CloudEvent type mapper module now exposes a new public API consisting of the CloudEventTypeMapper interface and its functional components, CloudEventTypeGetter and DomainEventTypeGetter, which allow users to define custom logic for mapping between domain event classes and CloudEvent type strings. This change also introduces Kotlin extension functions (cloudEventTypeOf, get, domainEventType) to simplify type mapping usage in Kotlin, along with JSpecify nullness annotations to improve null-safety for consumers of the API.
application/cloudevent-type-mapper/api · high confidence
New CloudEventConverter API for domain event conversion
A new API module has been introduced to handle the conversion between domain events and CloudEvents. This includes a Java interface, CloudEventConverter, which defines methods for converting individual events and batches (using List for writes), retrieving cloud event types, and null-safety annotations via JSpecify. Kotlin extension functions are also provided to allow idiomatic usage of the converter using operator overloading for type and event lookups.
application/cloudevent-converter/api · high confidence
New DCB pattern examples for price grace periods, idempotency, invoice numbering, opt-in tokens, and username uniqueness
Added five new Kotlin source files in the \example-domain-dcb-patterns\ module that demonstrate Domain-Driven Command Boundaries (DCB) for specific business scenarios. The \ProductPriceDecider\ implements a grace period allowing a previously displayed price to be honored for 10 minutes after a change. The \OrderDecider\ uses an idempotency token to prevent duplicate order placement on retries. The \InvoiceService\ provides a gapless, monotonically increasing invoice number sequence by reading the last event directly from the store. The \SignUpDecider\ enforces a double opt-in flow with a 15-minute expiration and one-time use constraint for the OTP. Finally, the \UsernameDecider\ ensures global username uniqueness with a 30-day retention period after an account is closed.
example-domain-dcb-patterns · high confidence
New DCB-only Spring Boot example for the Word Guessing Game
A new example application has been added to demonstrate the Dynamic Consistency Boundary (DCB) capability within the Spring Boot ecosystem. This example configures the application to use only the DCB event-store capability, explicitly disabling the standard STREAM API (which throws UnsupportedOperationExceptions when accessed) and wiring up the necessary DCB-specific components like the DcbDecider and DcbDomainEventQueries. It serves as a reference for users implementing DCB patterns with MongoDB in a Spring Boot environment.
example/domain/word-guessing-game/mongodb/spring/dcb-autoconfig · high confidence
New DataFieldReader interface for pluggable payload field access
The in-memory filter-matching module now exposes the DataFieldReader interface, allowing stores to plug in custom logic for reading fields from CloudEvent data payloads (e.g., Jackson-based parsing) to support data-based filtering. It includes a default readAll method for efficient bulk reads and a refusing() implementation that throws an exception if no reader is provided, ensuring that data filters are rejected early if the store cannot support them.
common/inmemory/filter-matching/src/main/java/org/occurrent/filtermatching · high confidence
New DcbEventMetadata wrapper for DCB-specific event metadata
A new DcbEventMetadata class has been added to the DCB DSL common module, providing a Java-friendly view over the generic EventMetadata. This wrapper exposes the event's global position as an OptionalLong and its DCB tags as a Set of Tag objects, allowing both blocking and reactive DCB DSLs to access these specific metadata fields while delegating generic subscription metadata to the underlying EventMetadata instance.
occurrent-dcb-dsl-common · high confidence
New GameViewController and materialized view for game state
The example application now exposes a REST endpoint at /games/{gameId} to retrieve the current state of a Rock-Paper-Scissors game. This is powered by a new GameViewController that reads from a MongoDB-backed materialized view, which automatically updates the game read model (including status, moves, and stream version) in response to domain events like game initiation, moves, and outcomes.
example-rps-decider-web · high confidence
New JMH benchmark module for performance regression tracking
A new dev-only benchmark module has been added to provide reproducible, in-process performance measurements for key subsystems. It includes benchmarks for the blocking handover throughput (validating the ADR 108 live-push handler optimization), payload filter read costs (testing batched path resolution for memoization), reactor projection hand-off overhead (measuring the cost of boundedElastic thread switching), and coalescing flush efficiency (analyzing batch size and key density impacts). These benchmarks are opt-in via the Maven 'benchmarks' profile and are excluded from standard builds and releases.
benchmark · high confidence
New Java DSL for running DCB deciders and managing subscriptions
The blocking DSL now provides Java-specific entry points for Domain Command Bus operations. DcbDeciderApplicationService allows Java callers to execute commands with a DcbDecider, automatically resolving read boundaries and handling event tagging without manual wiring, and includes convenience methods to return the resulting state or events. Additionally, DcbSubscriptions offers a typed wrapper for subscribing to live DCB-tagged events, supporting criteria-based filtering, optional metadata exposure, and explicit subscription cancellation for ephemeral use cases like per-connection feeds.
dsl/dcb-dsl/blocking/src/main/java · high confidence
New Java facade for running Deciders
A new \DeciderApplicationService\ class is now available in the Java DSL, providing a thin wrapper around the existing \ApplicationService\ to execute commands against a \Decider\. This facade mirrors the functionality of the Kotlin \execute\ extension, allowing users to run single or multiple commands and retrieve the resulting state, events, or the full decision object. The package is also marked with JSpecify nullness defaults.
dsl/decider/src/main/java · high confidence
New Kotlin DSL for building MongoDB-backed materialized views
The view-dsl module now provides Kotlin extension functions to easily create and manage materialized views backed by MongoDB. Users can define views that evolve from event streams, with support for deriving view IDs from event metadata (such as stream ID or version). The DSL includes configuration options for handling duplicate key exceptions and optimistic locking failures (ignore, rethrow, or retry with exponential backoff). It also offers convenient methods to update views via stream subscriptions and to evolve view state from single events, lists, sequences, or iterables, ensuring efficient folding without unnecessary intermediate collections.
dsl/view-dsl/src/main/kotlin · high confidence
New Kotlin DSL for defining event-driven saga process managers
A new Kotlin DSL has been added to the \saga-dsl/common\ module, providing a type-safe, fluent API for building sagas (event-driven process managers). This DSL allows developers to define saga behavior using a block-based configuration that includes event correlation, state evolution (\evolve\), side-effect reactions (\react\), and timeout handling. It supports both simple and metadata-carrying handlers, explicit or derived event filters, and exposes a dedicated \TimerName\ type for managing saga timers, all while delegating to the underlying Java \Saga.Builder\ implementation.
dsl/saga-dsl/common/src/main/kotlin/org/occurrent/dsl/saga · high confidence
New Kotlin command composition and partial application extensions
Added Kotlin extension functions in the command-composition module to support functional command composition and partial application. Users can now chain commands using the \andThen\ infix operator or the \composeCommands\ function, which accept generic types (not just Lists or Sequences) and correctly handle event streams by returning only new events. Additionally, \PartialExtensions\ provide \partial\ functions for functions with up to 15 parameters, allowing users to fix arguments and create simpler command functions.
application/command-composition/src/main/kotlin · high confidence
New Kotlin extension functions for decider composition and application service execution
This change introduces a set of Kotlin-specific extension functions to simplify working with deciders. In \DeciderExtensions.kt\, users can now easily create deciders using the \decider()\ builder, widen type scopes with \adapt()\ and \adaptEvents()\, and combine multiple deciders using infix \compose\ syntax or vararg overloads for two, three, or four+ deciders. In \ApplicationServiceDeciderExtensions.kt\, new \execute\, \executeAndReturnDecision\, \executeAndReturnState\, and \executeAndReturnEvents\ methods allow direct execution of deciders against an \ApplicationService\, automatically handling event type widening so that feature-specific deciders can run against broader domain services without manual adaptation.
dsl/decider/src/main/kotlin · high confidence
New ListCommandComposition utility and JSpecify nullness defaults
A new ListCommandComposition class has been added to the command-composition module, providing static methods to compose multiple list-based commands (Function\<List\<T\>, List\<T\>\>) into a single function for sequential execution. Additionally, JSpecify nullness defaults have been applied to the package via package-info.java, marking the package as @NullMarked to enforce null-safety annotations.
application/command-composition/src/main/java/org/occurrent/application/composition/command · high confidence
New MongoDB CloudEvent serialization components
Added DocumentCloudEventReader and DocumentCloudEventWriter classes to handle the conversion between MongoDB BSON documents and CloudEvents. The reader supports parsing CloudEvent attributes and data payloads (including JSON objects, strings, and binary data) from MongoDB documents, while the writer serializes CloudEvents back into MongoDB documents, handling various content types and data formats.
occurrent-eventstore-mongodb-common · high confidence
New MongoDB-backed saga state store with flow saga support and retention warnings
Introduces SpringMongoSagaStateStore, a new MongoDB implementation for saga state that supports both core and flow sagas. Flow saga state is serialized field-by-field with domain events stored as CloudEvents to ensure package-independent stability. The store includes a diagnostic warning when retained events exceed 1,000 to prevent MongoDB document size limits, and uses atomic compare-and-save operations with optimistic locking. Failure records are flattened to top-level fields to allow quarantine operations even when state decoding fails.
dsl/saga-dsl/mongodb-spring/src/main · high confidence
New RabbitMQ broker example demonstrating CloudEvent and domain-level event loops
Added an end-to-end example in the RabbitMQ broker module that demonstrates forwarding events to RabbitMQ and consuming them back into projections. The example includes two hand-wired bootstrap classes—RabbitMqCloudEventLevelBootstrap and RabbitMqDomainEventLevelBootstrap—that wire the full loop (event store, CloudEvent forwarder, RabbitMQ source, and projection) without Spring Boot auto-configuration. The example supports both CloudEvent-level and domain-level event processing, using a shared OrderStatusProjection to track order states. Comprehensive tests verify the wiring, including smoke tests for the bootstraps and specific tests for the projection's handling of out-of-order events, redeliveries, and missing metadata.
example/broker/rabbitmq · high confidence
New RabbitMQ domain event sink and source implementations
The RabbitMQ blocking broker now includes two new domain-level components in the \org.occurrent.broker.rabbitmq.blocking.domain\ package. \RabbitMqDomainEventSink\ allows applications to publish domain events by converting them to CloudEvents and delegating to a configured \CloudEventSink\, handling metadata stripping and extension stamping. \RabbitMqDomainEventSource\ feeds messages from a RabbitMQ queue into a \DomainEventFeed\, managing the lifecycle of catch-up and live consumption, handling delivery acknowledgments based on routing outcomes, and implementing robust error handling for permanent failures and connection issues.
broker/rabbitmq/blocking/src/main/java/org/occurrent/broker/rabbitmq/blocking/domain · high confidence
New Rock-Paper-Scissors example web application
A new Spring Boot-based web application has been added to the example domain to demonstrate the Rock-Paper-Scissors game logic. This entry point configures the application with Jackson 3 for CloudEvent conversion, enables HAL hypermedia support, and sets up MongoDB with virtual threads. It exposes REST endpoints for initializing games and submitting moves, while the test configuration utilizes Testcontainers to manage a MongoDB replica set for integration testing.
example/domain/rps/decider-web · high confidence
New Spring Boot MongoDB blocking example for the Number Guessing Game
Added a new example application demonstrating the Number Guessing Game domain using Spring Boot with a MongoDB backend and blocking event processing. This implementation includes a web API for game interaction, CloudEvent serialization, and CQRS-style read models (game status and latest games overview) updated via @StreamSubscription event handlers.
example/domain/number-guessing-game/mongodb/spring/blocking · high confidence
New Spring Boot auto-configuration infrastructure and subscription control
This release introduces a new common auto-configuration module for Spring Boot, adding a \SubscriptionMode\ enum that lets you control subscription lifecycle via \occurrent.subscription.mode\ (supporting \AUTO\, \MANUAL\, and \DISABLED\ states). It also adds a Jackson 3-based \CloudEventConverter\ with automatic module discovery and configurable time precision, along with several Spring \@Conditional\ classes to gate beans based on event store capabilities (like DCB and STREAM) and subscription settings. The configuration properties have been restructured to use store-qualified prefixes (e.g., \occurrent.event-store.mongodb.collection\), with deprecated keys still supported during migration.
framework/spring-boot-autoconfigure/common · high confidence
New Spring Boot example for ad-hoc MongoDB event store projections
This location introduces a new Spring Boot-based example application that demonstrates how to record events and build ad-hoc projections using MongoDB. The example includes a \WorkoutRecorder\ component that writes CloudEvents to the event store, a \MostNumberOfWorkouts\ projection that uses Spring Data MongoDB aggregation to find the person with the most completed workouts, and a \SpringAdhocProjectionApplication\ configuration class that wires up the \EventStore\ and transaction management. A corresponding test verifies the end-to-end flow by recording workout events and asserting the projection results.
example/projection/spring-adhoc-eventstore-mongodb-queries · high confidence
New Spring Boot starter for RabbitMQ blocking broker sources and sinks
This change introduces a new Spring Boot starter for the RabbitMQ blocking broker, providing auto-configuration for event sources and sinks. It adds the \@EnableOccurrentRabbitMqBroker\ annotation to activate the configuration, which requires the application to supply a \com.rabbitmq.client.Connection\ bean. The starter registers a \RabbitMqCloudEventSink\ for publishing events and a \RabbitMqCloudEventSourceFactory\ for consuming from queues, pre-seeding sources with connection details, retry strategies, and topology declaration settings. It also includes a \CatchupThenPushReadiness\ mechanism to manage readiness for sources wrapped in catch-up subscriptions, ensuring correct pacing without starving healthy sources. Configuration is driven by \occurrent.broker.rabbitmq.\*\ properties, allowing customization of exchange names, retry policies, polling intervals, and delivery failure handling.
broker/rabbitmq/spring-boot-starter/src/main/java/org/occurrent/springboot/broker/rabbitmq/blocking · high confidence
New Spring Boot starter for the Kafka broker
This location introduces the Spring Boot auto-configuration for the Kafka broker, providing a zero-config path to set up the Kafka CloudEvent sink and consume bridges. It registers a \KafkaCloudEventBridgeFactory\ that pre-seeds bridge builders with application properties (bootstrap servers, timeouts, retry strategies) and a readiness source that correctly handles \CatchupThenPushSubscriptionModel\ wrappers to prevent message loss during replay. The starter also includes a domain-level configuration for \KafkaDomainEventSink\ and \KafkaDomainEventBridgeFactory\, handling ambiguity when both Kafka and RabbitMQ starters are present by preferring the application's own \CloudEventConverter\ and resolving sink bean conflicts via fallback logic.
example/domain/number-guessing-game/mongodb/native, example/projection/spring-subscription-based-mongodb-projections · high confidence
New Spring MongoDB blocking snapshot store implementation
A new Spring-based blocking snapshot store for MongoDB has been added, allowing users to persist event-sourced snapshots directly to MongoDB using Spring Data's MongoOperations. This implementation stores each snapshot as a document containing the state, version, and schema version, and gracefully degrades to a full replay if a stored snapshot becomes unreadable due to schema changes.
occurrent-snapshot-dsl-mongodb-spring-blocking · high confidence
New Spring transaction executors with conflict-aware retry
Added Spring-backed transaction executors for both blocking (SpringTransactionExecutor) and reactive (SpringReactiveTransactionExecutor) stacks. These components wrap event-store writes and synchronous subscription handlers in a single Spring-managed transaction, ensuring they commit or roll back together. They implement a specific retry strategy for transient database conflicts (up to 15 attempts with exponential backoff) that only activates when the executor itself opened the transaction, preventing futile retries when joining an existing transaction context. The executors also correctly report their transactional state based on the configured propagation behavior.
application/service/transaction-spring · high confidence
New Spring-based MongoDB subscription projection example
This location now provides a complete example application demonstrating how to build projections using Spring Boot and MongoDB with the library's subscription model. It includes a domain model (CurrentName), an application service for defining and changing names, and a projection updater that listens to CloudEvents via a durable subscription to keep the MongoDB projection in sync. The example also features the necessary Spring configuration beans for the event store, checkpoint storage, and durable subscription, along with integration tests using Testcontainers to verify asynchronous projection updates.
broker/kafka/spring-boot-starter/src/main · high confidence
New TimeRepresentation enum for MongoDB CloudEvent persistence
A new TimeRepresentation enum has been introduced in the MongoDB module to let users choose how the CloudEvent 'time' field is stored in the database. Users can now select between RFC\_3339\_STRING, which preserves nanosecond precision and timezone information (recommended for most cases, though range queries require consistent UTC offsets), and DATE, which stores time as a MongoDB Date object (losing nanosecond precision and timezone info but enabling native range queries). The package is also marked with JSpecify nullness defaults.
common/mongodb/timerepresentation · high confidence
New Word Guessing Game example with Dynamic Consistency Boundary support
This location introduces the core domain logic and DCB integration for the Word Guessing Game example. It adds the \WordGuessingGameDecider\, which defines the game state machine (NotStarted, Ongoing, Ended) and handles commands to start a game and process word guesses, including logic for winning, losing, and exhausting guesses. Additionally, it provides the \RevealCharacterInWordHintAfterPlayerGuessedTheWrongWord\ component, a DCB subscription that listens for wrong guesses and automatically reveals characters in the word hint based on a configurable threshold, demonstrating how to couple a decider with a DCB boundary and tags.
example-domain-word-guessing-game-eventstore-mongodb-spring-dcb-autoconfig · high confidence
New XStream-based CloudEvent converter for domain events
A new XStreamCloudEventConverter implementation is now available in the application/converter/xstream module, allowing users to serialize domain events to CloudEvents using XML (defaulting to application/xml with UTF-8) via XStream. The converter supports configurable mapping for event IDs (defaulting to random UUIDs), event types (defaulting to the domain event class simple name), timestamps (defaulting to current UTC time), and subjects (defaulting to null), and includes a builder for advanced configuration.
application/cloudevent-converter/xstream/src/main · high confidence
New applied-append tracking and replay coalescing in projection DSL
The projection DSL now includes an \AppliedAppendStore\ interface and \AppliedAppendRecording\ state machine that let projections record and wait for specific event appends to be applied, enabling reliable read-your-writes semantics without relying on position-based tracking. Additionally, a new \MaterializedViewOptions\ record introduces a configurable \batchSize\ (default 1000) to coalesce materialized view updates per key during catch-up replays, reducing I/O overhead by buffering events before flushing.
occurrent-projection-dsl-common · high confidence
New blocking DCB query API with type and tag shortcuts
Introduces the DcbDomainEventQueries class for the blocking stack, enabling queries against Dynamic Consistency Boundary (DCB)-capable event stores. This API wraps standard domain event queries to provide DCB-specific methods like query(DcbCriteria) and queryWithPosition, while adding convenience shortcuts for filtering by event type (types) and tags (tags, tagsAnyOf) to simplify common query patterns.
occurrent-dcb-dsl-blocking · high confidence
New blocking DomainEventQueries API for event store reads
A new \DomainEventQueries\ class has been added to the blocking query DSL, providing a wrapper around \EventStoreQueries\ that automatically maps CloudEvents to domain event types using a \CloudEventConverter\. This API supports querying by filter or specific event types, with overloads for pagination (skip/limit) and sorting, and is designed to integrate with projections for strongly consistent reads. The package is marked with JSpecify null-safety annotations (\@NullMarked\).
dsl/query-dsl/blocking/src/main/java · high confidence
New blocking competing-consumer subscription model
Introduces the \CompetingConsumerSubscriptionModel\ and \CompetingConsumerSubscription\ classes, enabling multiple subscribers to compete for a single subscription ID where only one active consumer receives events at a time. The model wraps an underlying subscription model and uses a pluggable \CompetingConsumerStrategy\ (such as \NativeMongoLeaseCompetingConsumerStrategy\ or \SpringMongoLeaseCompetingConsumerStrategy\) to manage distributed locking and lease handovers. It ensures that when a consumer loses its lease, another subscriber automatically takes over, and it includes specific logic to resume from the correct checkpoint upon regaining the lease to prevent event redelivery or checkpoint regression. The module also includes comprehensive integration tests verifying lease transfer, checkpoint fence isolation, and start position handling.
subscription/util/blocking/competing-consumer-subscription · high confidence
New blocking projection DSL with push-source support and replay coalescing
This location introduces the core Java classes for a higher-level blocking projection DSL. It adds DomainEventFeed, allowing projections to be driven by external push sources (like RabbitMQ or Kafka) by accepting domain events directly without CloudEvent conversion on the live path. It also introduces ProjectionRunner to simplify subscription and materialization, and Projections to create MaterializedViews that coalesce reads and writes per key during catch-up replays for better performance. Additionally, RecordingMaterializedView is added to track applied appends, enabling read-your-writes consistency for asynchronous projections.
dsl/projection-dsl/blocking/src/main/java · high confidence
New blocking subscription test utilities for event and lock-change recording
The blocking subscription TCK now includes two new helper classes, RecordedEvents and RecordedLockChanges, to standardize how test suites observe and assert on subscription behavior. RecordedEvents acts as a Consumer for CloudEvents, using a blocking queue to wait for specific counts or conditions within a timeout, allowing tests to assert on arrival order and completeness without polling. RecordedLockChanges implements CompetingConsumerListener to track lock grant and prohibition events in the same blocking manner, enabling assertions on competing consumer strategy behavior. These utilities provide a consistent, non-polling mechanism for test suites to verify that blocking subscriptions and competing consumer strategies behave as expected.
occurrent-tck-subscription-blocking · high confidence
New command-dispatch module with batch-atomic dispatch and invocation-based commands
The application/command-dispatch module introduces a new producer-facing port for issuing commands, allowing sagas and policies to dispatch commands without knowing the write mechanics. It provides a CommandDispatcher interface with dispatchAll support for batch atomicity, grouping consecutive commands targeting the same stream into single appends. Two factory methods in CommandDispatchers enable decider-backed dispatch and invocation-based dispatch, where commands carry their own domain function. The Invocation record allows sagas to issue domain functions directly against streams, eliminating the need for command records in saga reactions. A ForwardingCommandDispatcher base class ensures decorators correctly forward both dispatch and dispatchAll methods, and a StreamIdResolver functional interface derives target stream IDs from commands.
application/command-dispatch/src/main · high confidence
New core Saga DSL and Flow Saga implementation
This change introduces the foundational types and execution model for the new event-driven saga DSL. It adds the core Saga interface, which defines the pure functions for evolving state and reacting to events or timeouts, along with supporting types like SagaInput (unifying domain events and timers), SagaEnvelope (persisting instance state, timers, and watermarks), and SagaFailure (tracking quarantine budgets). The Flow Saga implementation provides a step-based workflow model with compiled step graphs, branch continuations, and configurable event history windows (stepWindow and historyWindow) to manage retained event context. An in-memory state store is also provided for testing and single-node scenarios, implementing atomic compare-and-save operations and queries for due timers and status-based filtering.
occurrent-saga-dsl-common · high confidence
New declarative annotations for projections, sagas, and subscriptions
The framework introduces a new set of annotations in the \framework/annotations\ module to simplify the declaration of event-driven components. \@Projection\ and \@Snapshot\ allow developers to define read models and snapshot views with declarative configuration for stores, start positions, and processing modes (including synchronous read-your-writes). \@Saga\ registers event-driven process managers with built-in state management and command dispatching. \@DcbSubscription\ and \@DcbTag\ provide support for Dynamic Consistency Boundaries, enabling subscriptions scoped by event tags. Additionally, \@Source\ and \@Catchup\ annotations allow projections and sagas to be fed from external push sources (like Kafka or RabbitMQ) with configurable history replay behavior.
framework/annotations · high confidence
New event-store API primitives: AppendId, WriteResult, StreamReadFilter, SortBy, and PositionRange
The event-store API now exposes several new types that change how applications interact with the store. Write operations return a WriteResult containing the stream ID, the previous and new stream versions, and an optional AppendId stamped on every event in the append, enabling read-your-writes checks. Writing is guarded by a sealed WriteCondition interface (with StreamVersionWriteCondition) that throws WriteConditionNotFulfilledException when the condition fails. Reads can now be constrained by a StreamReadFilter DSL (filtering on CloudEvent attributes, extensions, and data) and ordered via a fluent SortBy API (supporting time, stream version, natural order, and multi-field composition), with unsorted as the default. Position-based reads use a validated PositionRange record to specify exclusive lower and inclusive upper bounds on the global monotonic position. Additionally, DuplicateCloudEventException now carries a details field to explain why a duplicate was detected, and LongConditionEvaluator provides the runtime logic for evaluating Long-typed conditions.
eventstore/api/common/src/main/java/org/occurrent/eventstore/api · high confidence
New example demonstrating transactional projections with Spring Reactor and MongoDB
Added a new example project that demonstrates how to implement transactional projections using Spring Boot, Spring Data MongoDB (Reactive), and the Occurrent event store. The example includes a \NameApplicationService\ that atomically writes domain events to the event store and updates a MongoDB projection (\CurrentName\) within the same reactive transaction, ensuring consistency. It also provides the necessary configuration beans (\ReactiveMongoTransactionManager\, \ReactorMongoEventStore\) and integration tests using Testcontainers to verify that events are not persisted if the projection update fails.
example/projection/spring-reactor-transactional-projection-mongodb · high confidence
New example: forward MongoDB events to Spring Application Events
This location now provides a complete Spring Boot example that subscribes to MongoDB change streams and publishes the resulting domain events to the Spring ApplicationEventPublisher. The example wires a durable subscription model (ReactorDurableSubscriptionModel) backed by MongoDB checkpoints, converts incoming CloudEvents to domain events using Jackson 3, and demonstrates graceful shutdown via @PostConstruct/@PreDestroy lifecycle hooks. It includes integration tests using Testcontainers to verify end-to-end event forwarding and unit tests for the event converter round-trip.
example/forwarder/mongodb-subscription-to-spring-event · high confidence
New example: transactional projections with Spring and MongoDB
This location introduces a new example application demonstrating how to maintain a MongoDB projection in the same database transaction as the event store write. The example includes a Spring Boot application that configures a MongoTransactionManager and a SpringMongoEventStore, a domain model (CurrentName) and a Spring Data repository (CurrentNameProjection), and an application service (NameApplicationService) that ensures events and the projection are committed atomically. Tests verify that both the event stream and the projection are updated together, and that the transaction rolls back if the projection save fails.
example/projection/spring-transactional-projection-mongodb · high confidence
New feature-based CloudEvent converter for the word guessing game
A new \GameCloudEventConverter\ has been added to the \features\ package to handle serialization and deserialization of game domain events into and from CloudEvents. This converter maps specific game events (such as \GameWasStarted\, \PlayerGuessedTheWrongWord\, and \CharacterInWordHintWasRevealed\) to distinct CloudEvent types and sources, enabling more granular event routing and processing based on the specific feature context within the word guessing game.
example-domain-word-guessing-game-eventstore-mongodb-spring-blocking · high confidence
New functional stream utilities and nullness defaults in common/functional-support
The common/functional-support module now includes a new FunctionalSupport class providing stream utilities such as autoClose (which ensures streams are closed after consumption), mapWithIndex, and zip, alongside a Pair helper class. Additionally, the internal package is now marked with JSpecify @NullMarked defaults to enforce null-safety annotations across the package.
common/functional-support · high confidence
New generic CloudEvent converter with configurable type mapping
A new GenericCloudEventConverter has been added to the application layer, allowing users to convert between domain events and CloudEvents using custom serialization functions. This implementation introduces explicit control over how the CloudEvent type is determined via a CloudEventTypeGetter, moving away from implicit reflection-based naming to a configurable approach. The component is marked with JSpecify nullness defaults to improve type safety.
application/cloudevent-converter/generic · high confidence
New in-memory checkpoint storage implementations for blocking and reactive APIs
Added in-memory implementations of the checkpoint storage contract for both the blocking and reactive (Reactor) APIs. These new classes store checkpoints in memory using concurrent maps, making them suitable for testing and small applications where checkpoint persistence across restarts is not required. Both implementations fully support checkpoint write conditions (such as 'NotOlderThan' and 'IfAbsent') and delete conditions, ensuring that conditional logic is evaluated rather than ignored.
occurrent-subscription-inmemory · high confidence
New in-memory subscription and checkpoint storage for testing
This change introduces the \subscription/inmemory\ module, providing an in-memory implementation of the blocking and reactive subscription models and checkpoint storage. The \InMemorySubscriptionModel\ uses a \ConcurrentHashMap\ and per-subscription \BlockingQueue\s to deliver events in order, supporting both standard stream subscriptions and DCB (Data-Centric Business) subscriptions with tag-based filtering. It also includes an in-memory \CheckpointStorage\ that evaluates write conditions (such as \NotOlderThan\ and \IfAbsent\) using separate maps for checkpoints and versions, making it suitable for unit tests and small applications where persistence across restarts is not required. The module includes comprehensive conformance tests against the TCK suites for both subscription models and checkpoint storage.
subscription/inmemory · high confidence
New internal reflection scanner for annotated members
The common/annotation-support module now includes an internal AnnotatedMemberScanner that finds class members annotated with a specific marker and binds them to MethodHandles for reading. It handles Java records (scanning components in declaration order) and regular classes (scanning getters before fields, collapsing properties annotated on both getter and field into a single entry, and walking the class hierarchy). The scanner caches results per class for performance and throws AnnotatedMemberScanException if a member cannot be accessed due to Java module restrictions. Tests verify correct behavior for records, getters, fields, hierarchy walking, caching, and error cases.
common/annotation-support, occurrent-annotation-support · high confidence
New native MongoDB event store implementation
A new \MongoEventStore\ implementation is introduced that uses the MongoDB Java synchronous native driver instead of the previous driver. This store supports both stream-based and DCB (Distributed Consensus Barriers) capabilities, with DCB enabled via configuration. It includes support for stream read filters, configurable query options, and synchronous subscriptions. The implementation handles position tracking, DCB checkpoints, and repairs for events damaged by previous \updateEvent\ operations, while ensuring correct sorting and indexing for performance.
occurrent-eventstore-mongodb-native · high confidence
New order-fulfillment saga example with core and flow DSL implementations
The order-fulfillment example now demonstrates how to model a distributed process using the saga pattern, providing two distinct implementation styles. The core Java implementation uses an explicit, per-event-type fold and reaction builder to manage state transitions (awaiting payment, completed, cancelled) and handle timeouts. The Kotlin implementation offers a declarative flow DSL alternative, expressing the same process with a concise step-based syntax including branches for payment success/failure and timeout handling. Both examples include domain events and commands, state definitions, and comprehensive tests that verify the saga runner's behavior, including decider-free and decider-backed command dispatching.
example/saga/order-fulfillment · high confidence
New point-awarding handler for correct word guesses
The word guessing game example now includes a dedicated component that awards points to a player when they guess the correct word. This handler listens for the PlayerGuessedTheRightWord event, queries the game start event to identify the game context, and calculates the total number of guesses made by the player (including the correct one) to determine the point basis. It executes the point awarding logic within a transactional scope and includes a retry mechanism with exponential backoff to handle potential 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/pointawarding · high confidence
New pragmatic RPS domain model implementation
Added a new implementation of the Rock-Paper-Scissors domain model in the \example-pragmatic-rps-model\ module. This includes the \Behavior.kt\ file, which defines the core game logic for creating games, joining players, and playing hands, along with \Events.kt\, which introduces the event types (such as \GameCreated\, \HandPlayed\, and \GameWon\) used to track the state evolution of the game.
example-pragmatic-rps-model · high confidence
New pragmatic Rock-Paper-Scissors domain model and application service demo
This change introduces a new pragmatic implementation of the Rock-Paper-Scissors (RPS) domain model within the example project. It adds core domain entities and value classes (such as PlayerId, GameId, and HandShape) along with specific exception types for game state validation. Additionally, it provides an ApplicationServiceDemo that illustrates how to use the Occurrent GenericApplicationService to execute RPS commands, including single and composed commands with partial function application, and demonstrates storing events as CloudEvents using both simple and custom Jackson-based converters.
example/domain/rps/pragmatic-model · high confidence
New projection DSL examples for Java and Kotlin
The example-projection-projection-dsl module now includes new example code demonstrating the projection DSL in both Java and Kotlin. The Java examples show how to build a stream-agnostic read model for order status using the handler builder, and define sealed interfaces for coupon events. The Kotlin examples demonstrate building a current name projection using the handler-builder DSL, including how to use explicit filters to scope subscriptions to specific users, as well as a DCB (Data-Centric Business) projection for checking if a username is claimed.
example-projection-projection-dsl · high confidence
New projection-dsl examples for DCB and stream-based projections
The example/projection/projection-dsl location now includes concrete examples and tests for building and running projections using the DSL. This includes a Java example for a single-instance, tag-scoped DCB (Data-Centric Business) projection (CouponRedemption) with both push (subscription-fed) and pull (query-folded) modes, and a Kotlin equivalent (UsernameClaimProjection). Additionally, it provides examples for stream-based projections (OrderStatus, CurrentName) fed by change streams, direct domain events, and external push sources (like RabbitMQ/Kafka via PushSubscriptionModel), demonstrating how to materialize read models in various scenarios.
example/projection/projection-dsl · high confidence
New reactive MongoDB snapshot store implementation
A new ReactiveSpringMongoSnapshotStore class has been added to the mongodb-spring-reactor module, providing a reactive implementation of the ReactiveSnapshotStore interface backed by MongoDB. This component allows users to store and retrieve event-sourced snapshots using Spring Data's reactive MongoDB operations, with automatic serialization/deserialization of state objects and graceful degradation to full replay if a stored snapshot becomes unreadable.
occurrent-snapshot-dsl-mongodb-spring-reactor · high confidence
New reactive hotel-booking example demonstrating Dynamic Consistency Boundaries
A new example application has been added to showcase Occurrent's Dynamic Consistency Boundary (DCB) support on the reactive stack (Project Reactor + Spring WebFlux). This Kotlin-based demo mirrors the existing blocking course-enrollment example but uses the reactive MongoDB starter to provide a live activity feed via Server-Sent Events. It illustrates how to model cross-entity rules (preventing double-booking and limiting active bookings per guest) atomically using DCB tags, leveraging the reactive DcbApplicationService and automatic subscription cancellation in WebFlux.
example/domain/hotel-booking · high confidence
New update-event-repair tool for MongoDB event stores
A new \UpdateEventRepair\ utility has been added to the MongoDB event store migration package to fix events damaged by the pre-0.34.0 \updateEvent\ implementation. This tool repairs events where the \position\ was incorrectly stored as a string and the \dcbTags\ array was missing, making them invisible to DCB reads and position-ordered queries. It includes a \report()\ method to size the damage and a \run()\ method to perform the repair in batches with checkpointing for safe resumption. The tool also identifies and reports unrecoverable damage, such as lost positions or invalid position values, via \UnrecoverableEvent\ findings.
eventstore/migration/update-event-repair, occurrent-eventstore-mongodb-update-event-repair · high confidence
Number Guessing Game domain model introduced
The model layer for the number guessing game example now includes the core domain classes, value objects, and event records. This adds the \NumberGuessingGame\ aggregate root with logic for starting games and processing guesses, along with value objects like \Guess\, \MaxNumberOfGuesses\, and \SecretNumberToGuess\. It also introduces a sealed \GameEvent\ interface and specific event records (e.g., \NumberGuessingGameWasStarted\, \PlayerGuessedTheRightNumber\) to track game state changes, supported by unit tests for the game logic.
example/domain/number-guessing-game/model · high confidence
OpenRewrite migration recipes for Occurrent 0.30.0 through 0.34.0
The \rewrite\ module now provides a suite of OpenRewrite recipes that automate upgrades to Occurrent releases 0.30.0, 0.31.0, 0.32.0, and 0.34.0. For 0.30.0, the recipes handle mechanical type and package renames (such as \SubscriptionPosition\ to \Checkpoint\) and migrate the write-side API from \Stream\ to \List\, flagging complex stream pipelines for manual review. The 0.31.0 recipes rename checkpoint-storage module coordinates (e.g., \-position-storage\ to \-checkpoint-storage\) and move annotation enums like \ResumeBehavior\ and \EventMetadata\ to new top-level packages. The 0.32.0 recipes update the deprecated \occurrent.subscription.enabled\ configuration property to \occurrent.subscription.mode\ in both \.properties\ and \.yaml\ files, and rename the reactor \SubscriptionModel\ to \FluxSubscriptionModel\. For 0.34.0, the recipes stub missing \CheckpointStorage\ conditional write members to ensure compilation, drop redundant MongoDB-specific configuration keys from YAML documents, flag \Object\-typed capability lookups that need narrowing, add the new \appendId\ binding to \WriteResult\ record patterns, and rewrite the deprecated \StepBuilder.join\ API to \StepCondition.allOf\.
rewrite · high confidence
Published Event Store TCK with concurrency and capability conformance suites
The \tck/eventstore-blocking\ module now includes a published Test Compatibility Kit (TCK) that allows implementations to verify their event store behavior against a standardized suite. This update introduces new infrastructure classes, including \ConcurrentRendezvous\ for reliable race-condition testing and \FailureNamesTheTestClass\ for clearer test reporting, alongside comprehensive conformance suites. These suites validate that stores correctly handle DCB (Distributed Consistency Boundary) concurrency scenarios, such as write-write collisions and disjoint boundary independence, and enforce capability guards by refusing operations on stores that were not built with the required features (e.g., DCB or Stream capabilities).
tck/eventstore-blocking · high confidence
Reactive API for Dynamic Consistency Boundary event store operations
A new reactive interface, DcbEventStore, has been added to the DCB Reactor module, providing non-blocking read and append operations for Dynamic Consistency Boundary events. This API mirrors the existing blocking DcbEventStore but returns Reactor Mono types, allowing users to perform DCB-specific reads (using DcbCriteria and DcbReadOptions), existence checks, counts, and conditional appends asynchronously while reasoning in DCB terms like tags and sequence positions rather than underlying storage stream IDs.
eventstore/api/dcb-reactor/src/main/java/org/occurrent/eventstore/api/dcb/reactor · high confidence
Reactive DCB DSL extensions for Deciders and Subscriptions
This release adds a new reactive DSL layer in the \dsl/dcb-dsl/reactor\ module, providing Kotlin-idiomatic extensions for Domain-Centric Business (DCB) operations. For Deciders, \DcbApplicationServiceDeciderExtensions\ introduces \execute\ and \executeAndReturnDecision\ functions that accept a \DcbDecider\ directly, automatically deriving the read boundary and applying event tags via \DcbExecuteOptions\, while ensuring unrecognized commands throw \IllegalArgumentException\. For querying, \DcbDomainEventEventQueriesExtensions\ offers convenience methods like \queryForList\ and \queryForListWithPosition\ to collect reactive streams into lists, along with a \types()\ shortcut for reified type filtering. Finally, \DcbSubscriptions\ provides \subscribeDcb\ and \subscribeDcbWithMetadata\ functions that wrap the canonical subscription entry points, returning a \Subscription\ immediately without a \waitUntilStarted\ flag, allowing callers to compose the start-up phase into their own reactive chains.
dsl/dcb-dsl/reactor/src/main/kotlin · high confidence
Reactive MongoDB Event Store now supports DCB and configurable read/query options
The ReactorMongoEventStore implementation has been updated to support Deterministic Concurrency Control (DCB) operations, allowing users to enable DCB capabilities alongside standard stream operations. It also introduces configurable read and query options, enabling fine-grained control over MongoDB read preferences (such as reading from secondaries for queries) and query transformations. Additionally, the store now includes better handling for write conflicts, position management, and event repair validation.
occurrent-eventstore-mongodb-spring-reactor · high confidence
Reactive MongoDB checkpoint storage with conditional writes and race resolution
The new ReactorCheckpointStorage provides a reactive implementation of CheckpointStorage for MongoDB, enabling subscriptions to persist checkpoints using reactive streams. It supports conditional checkpoint writes via CheckpointWriteCondition, allowing operations like 'NotOlderThan' to prevent overwriting newer state, and includes logic to resolve first-checkpoint races specific to MongoDB operation times. The implementation also adds retry logic for transient MongoDB errors and ensures that refused writes are handled without unnecessary retries.
occurrent-subscription-mongodb-spring-reactor-checkpoint-storage · high confidence
Reactive MongoDB subscription model now supports pause, resume, and cancellation
The \ReactorMongoSubscriptionModel\ in the Spring Reactor module now implements lifecycle management interfaces, allowing users to pause, resume, and cancel individual subscriptions by ID in addition to the existing reactive stream primitives. This change introduces named, lifecycle-managed subscriptions that maintain their position correctly even when paused, ensuring that events written during a pause are delivered upon resume and that the subscription does not retain stale positions that could be dropped from the oplog. The model also includes a new \ReactorMongoSubscription\ record to represent the subscription handle and its start status.
occurrent-subscription-mongodb-spring-reactor · high confidence
Reactive application service and DCB support
This change introduces the reactive counterparts to the existing blocking application services. It adds a reactive ApplicationService interface and GenericApplicationService implementation that reads streams, applies domain functions, writes events with optimistic concurrency, and supports optional reactive side-effects and synchronous subscriptions. It also introduces a reactive DcbApplicationService and GenericDcbApplicationService for Dynamic Consistency Boundary operations, allowing domain decisions to be executed against events selected by DCB criteria with reactive reads and appends. Supporting types include ExecuteOptions and DcbExecuteOptions for configuring filters, side-effects, and snapshot-based execution, as well as ReactiveTransactionExecutor and ReactiveSynchronousEventDispatcher to manage transactional boundaries and synchronous event dispatch in a reactive context.
application/service/reactor/src/main · high confidence
Reactive projection DSL extensions for Reactor
Adds Kotlin extension functions to the Reactor stack that enable building read models via event subscriptions or on-demand query folding. Users can now run projections as asynchronous, subscription-fed read models against \Subscriptions\ (capability-agnostic) or \StreamSubscriptions\ (stream-scoped), with overloads that accept a reactive update function, a \ViewStateRepository\, or a \MaterializedView\. The API also exposes \EventMetadata\ to the update function for cases requiring stream ID or version information, and provides a strongly-consistent, query-driven \project\ function on \DomainEventQueries\ to fold events into view state on demand.
dsl/projection-dsl/reactor/src/main/kotlin · high confidence
Reactive push subscription model with catch-up and observer hooks
The \subscription/push/reactor\ module now provides a reactive subscription model (\CatchupThenPushSubscriptionModel\) that drives projections from external push sources like RabbitMQ or Kafka rather than event-store change streams. It replays historical events from a \PositionOrderedReader\ before handing over to a live \PushSubscriptionModel\ feed, ensuring read models are built from scratch if they were not running when events were written. The model introduces a \PushObserver\ interface to report routing outcomes (delivered, filtered, unavailable, etc.) for visibility into misconfigurations or handler failures, and enforces a one-model-per-subscription contract to prevent shared acknowledgement decisions. Comprehensive conformance and deadlock tests verify lifecycle stability, marker deletion reliability, and correct behavior during concurrent replay completion and cancellation.
subscription/push/reactor · high confidence
Reactive query DSL for domain events
A new reactive query DSL has been added to the \org.occurrent.dsl.query.reactor\ package, providing the \DomainEventQueries\ class as the reactive counterpart to the existing blocking queries. This component wraps the reactive \EventStoreQueries\ and uses a \CloudEventConverter\ to map results into domain event types, enabling non-blocking reads with support for filtering, pagination (skip/limit), and sorting. It also integrates with the projection DSL, allowing projections to be folded over queries for strongly consistent on-demand reads, and handles type expansion for sealed types to query all permitted concrete subtypes.
dsl/query-dsl/reactor/src/main/java · high confidence
Reactive snapshot support for Deciders, DCB, and Views
This change introduces the Reactor-based snapshotting layer for the DSL, providing reactive counterparts to the existing blocking snapshot components. It adds \ReactiveSnapshotStore\ for non-blocking snapshot persistence, \ReactiveSnapshotDeciderApplicationService\ to resume stream-based deciders from snapshots, \ReactiveSnapshotDcbDeciderApplicationService\ to resume Decider-Centric Boundary (DCB) deciders from snapshots keyed by criteria, and \ReactiveSnapshotViews\ (via \ReactiveSnapshotViewSource\) for snapshotting read-side views. The module also includes \ReactiveSnapshotSupport\ for the shared load/resume/persist logic and \SnapshotPolicies\ for decider-specific policies like \whenTerminal\.
dsl/snapshot-dsl/reactor/src/main · high confidence
Reactive stack annotation support and late bean subscription handling
The reactive Spring Boot auto-configuration now registers annotations (@Projection, @Snapshot, @Saga) and manages their lifecycle, including support for manual start modes and push-based subscriptions. A new ComposedCatchupModel resolves capability-lookup gaps in composed subscription models to ensure accurate catch-up status reporting. Late-registered beans (created after startup) are handled by LateSubscriber, which schedules subscriptions on a bounded elastic scheduler to avoid blocking on Reactor non-blocking threads, with retry logic for transient failures and strict refusal to block for dynamic start positions.
framework/spring-boot-autoconfigure/reactor · high confidence
Reactor projection DSL introduces metadata-aware updates and blocking view integration
The reactor projection DSL now supports event metadata in update functions via new overloads in ReactiveProjectionRunner and DomainEventFeed, allowing projections to key or fold on metadata. It also enables running blocking MaterializedView updates within the reactive pipeline by scheduling them on boundedElastic, preserving batching behavior through the new ReactiveReplayAware interface and BlockingMaterializedViewUpdate wrapper.
dsl/projection-dsl/reactor/src/main/java · high confidence
Reactor-based reactive Event Store API interfaces
The \eventstore/api/reactor\ module now provides a complete set of reactive interfaces for interacting with event stores using Project Reactor. This includes \EventStore\ for transactional read/write operations, \EventStoreOperations\ for advanced actions like conditional and filter-based deletion and event updates, and \EventStoreQueries\ for filtering, counting, and checking existence of events. The API also introduces \PositionOrderedReader\ for global position-based event replay and \EventStream\ as a reactive wrapper for stream data, enabling non-blocking event sourcing workflows.
eventstore/api/reactor/src/main/java/org/occurrent/eventstore/api/reactor · high confidence
Rock-Paper-Scissors domain model implementation
The example RPS model now includes the core domain logic for a Rock-Paper-Scissors game, defining the command and event structures (\CreateGame\, \PlayHand\, \GameCreated\, \RoundWon\, etc.) and the state machine behavior in \Behavior.kt\. This implementation enforces game rules such as best-of-1/3/5 rounds, player turn validation, and round/game outcome determination, providing a complete, albeit example-level, stateful state machine for the RPS use case.
example-rps-model · high confidence
Saga DSL blocking execution engine introduces quarantine and retry logic
The new SagaExecution class in the blocking saga DSL drives saga instances by loading state, processing events, and dispatching commands with at-least-once semantics. It implements a quarantine mechanism for instances that repeatedly fail, preventing a single failing saga from blocking other instances of the same saga type. The engine also handles compare-and-set conflicts with immediate retries and manages unroutable deliveries to avoid infinite redelivery loops.
occurrent-saga-dsl-blocking · high confidence
Saga DSL introduces a new event-driven process management API
This release adds a new Saga DSL for building event-driven process managers. The change introduces the core \SagaEffect\ interface to define pure saga reactions (issuing commands or managing timers), along with \SagaInstance\ and \SagaInstances\ to provide read-only operational visibility into saga lifecycles (status, failures, timers). It also defines the \SagaStateStore\ SPI for persistence with compare-and-set semantics and the \SagaStatus\ enum to track instance states like ACTIVE, COMPLETED, and QUARANTINED.
dsl/saga-dsl/common/src/main/java/org/occurrent/dsl/saga · high confidence
Saga DSL now supports issuing domain functions directly via Invocation
The blocking Saga DSL introduces new extension functions that allow sagas to issue a domain function directly instead of wrapping it in a command object. By accepting a stream ID and a decision function, these additions simplify the syntax for executing logic against event streams within saga reactions, removing the need for explicit command object construction.
dsl/saga-dsl/blocking/src/main/kotlin · high confidence
Server-rendered web controllers for course and student management
The course-enrollment example now includes server-rendered web pages for managing courses and students. A new CourseManagementController exposes endpoints to define new courses and cancel existing ones, while a StudentManagementController allows users to register and deregister students. Both controllers handle form submissions via POST requests and display immediate feedback messages to the user upon success or failure.
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/coursemanagement/web · high confidence
Server-side filtering for DCB subscriptions in MongoDB
MongoDB change stream subscriptions now support server-side filtering for Domain Change Boundary (DCB) events, significantly improving efficiency by pushing type, tag, and exclusion constraints to the database. The new \DcbSubscriptionFilterConverter\ translates \DcbCriteria\ into MongoDB \$match\ aggregation stages, ensuring that only events matching the specified types (any-of), tags (all-of), and excluded types (none-of) are delivered, while always enforcing the DCB tag existence check. Additionally, the \MongoFilterSpecification\ class provides a fluent API for applying custom BSON filters to subscriptions, allowing users to filter on Cloud Event attributes like ID, type, source, and data fields directly at the database level.
subscription/mongodb/common/base · high confidence
Spring MongoDB blocking subscription model introduces configurable execution and restart options
The new SpringMongoSubscriptionModelConfig allows users to configure the subscription model's behavior, including enabling virtual threads for change-stream reading, setting a custom max await time for the MongoDB change stream, and enabling automatic restart when the oplog history is lost. It also supports providing a custom Executor and controlling auto-startup behavior, with tests verifying these configurations and the model's conformance to subscription standards.
subscription/mongodb/spring/blocking · high confidence
Spring-based MongoDB checkpoint storage with conditional writes and race resolution
A new Spring-integrated MongoDB checkpoint storage implementation is introduced for blocking subscriptions. It persists checkpoints using Spring's MongoOperations and supports conditional writes via CheckpointWriteCondition, ensuring that concurrent updates are handled correctly without silent fencing failures. The storage also resolves first-checkpoint races by comparing operation times, preventing event loss during initial subscription starts. Additionally, it includes a migration path for legacy checkpoint fields, automatically transitioning old subscription positions to the new format upon save.
subscription/mongodb/spring/blocking-checkpoint-storage · high confidence
Student management decider and domain model introduced
The student-management feature now includes a dedicated write-side model. A new StudentDecider handles student registration and deregistration commands, enforcing rules that prevent duplicate registrations or actions on unregistered students via specific exceptions. This is supported by new StudentEvent definitions (StudentRegistered, StudentDeregistered) and a StudentTags utility to tag events by student ID for the Decider Command Bus (DCB) boundary. Also in this area: Server-rendered web controllers for course and student management; Added student registration and deregistration use cases.
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/studentmanagement · high confidence
Test-support adds scoped MongoDB containers and domain example models
The test-support module now includes a new ReplicaSetReadyMongoDBContainer that prefixes database names with a unique scope (combining the JVM process ID and a container counter) to prevent concurrent test runs from deleting each other's data, and it also provides example domain models (NameDefined, NameWasChanged), command types (ChangeName, DefineName), and a CloudEvent converter to help users write tests.
test-support · high confidence
Unified subscription filtering and lifecycle management
The subscription core now introduces a capability-agnostic subscription model that unifies stream and DCB (Dynamic Consistency Boundary) event delivery under a single global position. Users can subscribe to events from all capabilities using the new AgnosticSubscriptionFilter, or scope subscriptions to specific capabilities via StreamSubscriptionFilter and DcbSubscriptionFilter. The system also introduces a CatchupListener interface to allow projections to track catch-up progress and handle duplicate events from replays, alongside a new Checkpoint interface and GlobalCheckpointSource for managing resume positions. Lifecycle management is strengthened with specific exceptions for refused states (DuplicateSubscriptionId, SubscriptionAlreadyRunning, StartPositionAlreadyPinned) and a new RoutingOutcome enum to clearly distinguish between delivered, filtered, deferred, unavailable, and refused events, enabling more robust error handling and broker integration.
subscription/core · high confidence
Word Guessing Game example adopts Dynamic Consistency Boundaries (DCB)
The word-guessing-game example has been migrated to use Dynamic Consistency Boundaries (DCB) for its gameplay features. This change introduces a new decider-based architecture for game logic, with application services (StartGame, MakeGuess) that execute commands within a DCB context and include retry logic for write conflicts. Event-driven views for ongoing and ended games now consume events via DCB-scoped subscriptions, ensuring that read-model updates are consistent with the game's state boundary. A new web interface exposes these features, allowing users to start games, make guesses, and view ongoing or ended game overviews.
example/domain/word-guessing-game/mongodb/spring/dcb-autoconfig/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/autoconfig/features/gameplay · high confidence
Word hint character revelation logic added to word guessing game example
The word guessing game example now includes logic to automatically reveal characters in the word hint. Two new event handlers have been added: one that reveals initial characters when a game starts, and another that reveals an additional character when a player guesses incorrectly. These handlers use Spring Retry to handle potential concurrency issues when updating the word hint state.
example/domain/word-guessing-game/mongodb/spring/blocking/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/blocking/features/wordhint · high confidence
Word hint characters are revealed based on game events
The word-guessing game now automatically reveals characters in the word hint. Initially, a set number of characters are revealed when the game starts. Subsequently, additional characters are revealed after each incorrect guess, up to a calculated maximum, ensuring the hint remains partially obscured.
example/domain/word-guessing-game/mongodb/spring/dcb/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/features/wordhint · high confidence
Removals
Removal of core EventStore interfaces and InMemory implementation
The \EventStore\, \EventStream\, \ReadEventStream\, and \WriteEventStream\ interfaces in \occurrent-core\ have been removed, along with the \InMemoryEventStore\ implementation and its associated test domain classes in \occurrent-inmemory\. This change eliminates the previous in-memory event storage capability and the core abstractions that defined reading and writing event streams, effectively removing this part of the event sourcing infrastructure from the library.
occurrent-core, occurrent-inmemory · high confidence
Behavioural changes
1 commit (0 fixes) modifying eventstore/api/blocking/src/main/java/org/occurrent/eventstore/api/blocking/internal, eventstore/api/dcb-reactor/src/main/java/org/occurrent/eventstore/api/dcb/reactor/internal, eventstore/api/reactor/src/main/java/org/occurrent/eventstore/api/reactor/internal
A change to existing behaviour in eventstore/api/blocking/src/main/java/org/occurrent/eventstore/api/blocking/internal, eventstore/api/dcb-reactor/src/main/java/org/occurrent/eventstore/api/dcb/reactor/internal, eventstore/api/reactor/src/main/java/org/occurrent/eventstore/api/reactor/internal — 1 commit, 9 files: “Read a catch-up's live start and replay through the event store (ADR 155) (\#1327)” (refs \#1327).
eventstore/api/blocking/src/main/java/org/occurrent/eventstore/api/blocking/internal, eventstore/api/dcb-reactor/src/main/java/org/occurrent/eventstore/api/dcb/reactor/internal, eventstore/api/reactor/src/main/java/org/occurrent/eventstore/api/reactor/internal · medium confidence · unverified
15 commits (2 fixes) modifying eventstore/mongodb/dcb-common/src/main
A change to existing behaviour in eventstore/mongodb/dcb-common/src/main — 15 commits (2 fixs), 6 files: “Align DCB criteria naming and Tag with the dcb.events spec (\#316)”; “Extract shared Mongo DCB code into a dedicated module (\#236)”; “Simplify comments in the event store implementations (\#309)”; and 12 more (refs \#316, \#236, \#309, \#1235, \#1315, …).
eventstore/mongodb/dcb-common/src/main · medium confidence · unverified
2 commits (0 fixes) modifying subscription/mongodb/native/blocking-competing-consumer-strategy
A change to existing behaviour in subscription/mongodb/native/blocking-competing-consumer-strategy — 2 commits, 2 files: “Use the url's database in the Mongo tests that connect with a scoped url (\#1335)”; “Native competing-consumer strategy shipped under the Spring package (\#562)” (refs \#1335, \#562).
subscription/mongodb/native/blocking-competing-consumer-strategy · medium confidence · unverified
3 commits (0 fixes) modifying example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/coursemanagement/model
A change to existing behaviour in example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/coursemanagement/model — 3 commits, 2 files: “WIP: restructure course-enrollment example into three feature deciders”; “Rename the DCB query DSL to criteria and make tags a first-class type (\#276)”; “Unenroll deregistered students from their courses” (refs \#276).
example/domain/course-enrollment/src/main/kotlin/org/occurrent/example/domain/courseenrollment/features/coursemanagement/model · medium confidence · unverified
3 commits (0 fixes) modifying example/domain/word-guessing-game/mongodb/spring/dcb/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/features/gameplay
A change to existing behaviour in example/domain/word-guessing-game/mongodb/spring/dcb/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/features/gameplay — 3 commits, 11 files: “Add Dynamic Consistency Boundary (DCB) support (\#201)”; “Organizing imports”; “Use List instead of Stream for event store writes (\#314)” (refs \#201, \#314).
example/domain/word-guessing-game/mongodb/spring/dcb/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/dcb/features/gameplay · medium confidence · unverified
3 commits (0 fixes) modifying occurrent-eventstore-mongodb-dcb-common
A change to existing behaviour in occurrent-eventstore-mongodb-dcb-common — 3 commits, 3 files: “Resume DCB reads from marker versions on MongoDB (\#1315)”; “Compare each DCB marker with what the read saw on MongoDB (\#1396)”; “Stop a DCB condition failing on an event that doesn't match it on MongoDB (\#1397)” (refs \#1315, \#1396, \#1397).
occurrent-eventstore-mongodb-dcb-common · medium confidence · unverified
3 commits (0 fixes) modifying occurrent-rewrite
A change to existing behaviour in occurrent-rewrite — 3 commits, 2 files: “Resume DCB reads from marker versions on MongoDB (\#1315)”; “Remove the deprecated saga join/expect/Expectation API (\#806) (\#821)”; “Refuse a dynamic start that first returns a catch-up's checkpoint (\#1376)” (refs \#1315, \#806, \#821, \#1376).
occurrent-rewrite · medium confidence · unverified
37 commits (2 fixes) modifying subscription/util/reactor/catchup-subscription
A change to existing behaviour in subscription/util/reactor/catchup-subscription — 37 commits (2 fixs), 17 files: “Tidy catch-up module naming and hide internal helpers (\#271)”; “Align DCB criteria naming and Tag with the dcb.events spec (\#316)”; “Fix a dynamic start position never matching the reactor catch-up dispatcher (\#570)”; and 34 more (refs \#271, \#316, \#570, \#1214, \#306, …).
subscription/util/reactor/catchup-subscription · medium confidence · unverified
4 commits (0 fixes) modifying eventstore/api/dcb/src/main/java/org/occurrent/eventstore/api/dcb/internal
A change to existing behaviour in eventstore/api/dcb/src/main/java/org/occurrent/eventstore/api/dcb/internal — 4 commits, 4 files: “Resume DCB reads from marker versions on MongoDB (\#1315)”; “Stop a DCB condition on a type and a tag from conflicting with every append of that type on MongoDB (\#1373)”; “Compare each DCB marker with what the read saw on MongoDB (\#1396)”; and 1 more (refs \#1315, \#1373, \#1396, \#1327).
eventstore/api/dcb/src/main/java/org/occurrent/eventstore/api/dcb/internal · medium confidence · unverified
5 commits (0 fixes) modifying occurrent-tck-common
A change to existing behaviour in occurrent-tck-common — 5 commits, 5 files: “Add TCK suites that show a late lower append being missed (\#1312)”; “Verify concurrent writes on every event store, and delete the tests that never ran in CI (\#476)”; “Simplify javadoc/kdoc across everything added since 0.31.0 (\#558)”; and 2 more (refs \#1312, \#476, \#558, \#1313).
occurrent-tck-common · medium confidence · unverified
6 commits (0 fixes) modifying occurrent-broker-kafka-blocking
A change to existing behaviour in occurrent-broker-kafka-blocking — 6 commits, 2 files: “Name the broker consume side a source, next to the sinks (\#1274)”; “Add Kafka consume bridges into the push feed (\#417)”; “Add the Kafka publish module with a shared topic as the default (\#416)”; and 3 more (refs \#1274, \#417, \#416, \#1285, \#1363, …).
occurrent-broker-kafka-blocking · medium confidence · unverified
8 commits (0 fixes) modifying subscription/mongodb/common/blocking/change-stream
A change to existing behaviour in subscription/mongodb/common/blocking/change-stream — 8 commits, 2 files: “A catch-up subscription no longer skips events when MongoDB drops its live start as the change stream opens (\#1267)”; “A paused MongoDB subscription resumed at a catch-up's checkpoint skips what was written while it was paused (\#1247)”; “Refuse a catch-up start that could skip an event committed below it (\#1351)”; and 5 more (refs \#1267, \#1247, \#1351, \#1174, \#1357, …).
subscription/mongodb/common/blocking/change-stream · medium confidence · unverified
Added JSpecify nullness defaults for the in-memory event store package
The in-memory event store package now enforces JSpecify nullness defaults via the @NullMarked annotation, ensuring that all public APIs in this package are treated as non-null by default unless explicitly annotated otherwise.
eventstore/inmemory/src/main · high confidence
Blocking Application Service introduces typed filters, side-effects, and transactional dispatch
The blocking Application Service now supports typed execute filters and synchronous side-effects via a new ExecuteOptions API, allowing users to filter events by type and run post-write logic (such as publishing events) directly after persistence. A new SideEffect utility simplifies composing these post-write handlers, while the service now returns a WriteResult to expose write metadata. Under the hood, a SynchronousEventDispatcher and TransactionExecutor interface enable atomic writes with synchronous subscriptions when a transaction is active, ensuring that handler failures either roll back the write or are reported collectively depending on transactional context.
application/service/blocking/src/main/java/org/occurrent/application/service/blocking · high confidence
Blocking projection feed now coalesces replay writes and fixes catch-up handover
The blocking projection DSL now uses a new CatchupProjectionFeed that coordinates catch-up and live event delivery via a shared BlockingHandover, preventing the feed from hanging when its own code triggers a catch-up and fixing issues where live events were lost or silently dropped during replay. Additionally, the CoalescingMaterializedView buffers events by key during catch-up and flushes them in batches, significantly reducing database read/write operations during replay compared to the previous per-event approach.
occurrent-projection-dsl-blocking · high confidence
Blocking stack introduces competing-consumer fencing and push-readiness wiring
The blocking Spring Boot auto-configuration now enforces strict validation for competing-consumer checkpoint fencing: it throws specific exceptions if multiple CompetingConsumerStrategy beans are present without a @Primary, or if the chosen strategy is paired with a CheckpointStorage that cannot evaluate write conditions. It also adds infrastructure to publish CatchupThenPushSubscriptionModel instances as named Spring beans and registers them in a central identity-based map, allowing separate CloudEvent broker starters to wire readiness checks against the exact push feed they consume.
framework/spring-boot-autoconfigure/blocking · high confidence
Blocking stream catch-up subscriptions now use virtual threads and stricter deduplication
The blocking stream catch-up subscription model has been refactored to run its replay work on virtual threads, improving concurrency and resource efficiency during the catch-up phase. The handover logic between the catch-up replay and the live subscription has been hardened to prevent lifecycle leaks, lost cancellations, and livelocks, ensuring that concurrent attempts to start or cancel a subscription are handled safely. Additionally, the deduplication cache for the replay-to-live handover has been increased in size (defaulting to 100,000 entries) and keyed by both event ID and source to prevent silent event loss when events with the same ID originate from different producers. The configuration now also supports specifying a DCB sequence-position window size for replay paging, though this is ignored in pure stream mode.
subscription/util/blocking/stream-catchup-subscription · high confidence
Centralized saga event filtering logic
The saga DSL now uses a shared internal component, SagaFilters, to determine which events a saga subscribes to. This logic, which combines replacement filters, derived type filters, and narrowing filters, is now centralized and independent of the specific subscription stack (blocking or reactor), ensuring consistent filtering behavior across different execution modes.
dsl/saga-dsl/common/src/main/java/org/occurrent/dsl/saga/internal · high confidence
Clarification of internal flow saga implementation scope
A new package-info.java file has been added to the internal flow saga package to explicitly document that its public types are implementation details intended only for cross-module state store access and are not part of the stable public API. This change reinforces that end users should author flow sagas through the public {@code org.occurrent.dsl.saga.flow} package and should not depend on internal classes, which may change or be removed without notice.
dsl/saga-dsl/common/src/main/java/org/occurrent/dsl/saga/flow/internal · high confidence
CloudEvents extension refactored with new metadata API and append ID support
The cloudevents-extension module has been restructured to align with the CloudEvents specification and SDK 2.0.0. The extension keys have been renamed to lowercase (e.g., 'streamid', 'streamversion', 'appendid') to comply with the spec. A new \EventMetadata\ class centralizes access to event attributes like stream ID, version, position, and the newly added append ID, ensuring consistent reading across subscription, saga, projection, and DCB DSLs. The \OccurrentCloudEventExtension\ now supports appending and preserving append IDs during event updates, and an \OccurrentExtensionRemover\ utility allows stripping Occurrent-specific extensions from CloudEvents. Additionally, accessors now handle JSON round-trip scenarios where numeric values are serialized as strings.
cloudevents-extension · high confidence
Course enrollment UI styled with Pico.css
The course enrollment web interface now uses the Pico.css framework (v2.0.6) for its visual design. This introduces a modern, accessible look with automatic support for light and dark themes, and includes custom styling for feedback messages, the activity feed, and action buttons.
example/domain/course-enrollment/src/main/resources/static · high confidence
Course enrollment example restructured into three feature deciders
The course-enrollment example has been reorganized into three distinct feature deciders to demonstrate Dynamic Consistency Boundaries (DCB). The new structure includes a CourseDecider for defining and cancelling courses, a StudentDecider for registering and deregistering students, and a cross-boundary EnrollmentDecider that enforces invariants across both entities (such as course capacity and per-student limits). This change introduces specific domain events (CourseDefined, CourseCancelled, StudentRegistered, StudentDeregistered, StudentEnrolledInCourse, StudentUnenrolledFromCourse) and read models (CourseDashboard and CourseDetail) to support the new decider architecture.
example-domain-course-enrollment · high confidence
Durable subscription model now refuses subscriptions when no start position can be recorded
The blocking durable subscription model now prevents silent data loss by refusing to start a subscription if it cannot record a start position (e.g., when the underlying event store returns null for the global checkpoint and no checkpoint is stored). Previously, such subscriptions would start from an unknown position, risking the loss of early events. Users can opt out of this strict behavior by configuring the model to start anyway, accepting the potential loss window.
subscription/util/blocking/durable-subscription · high confidence
EventMetadata class moved to cloudevents-extension
The EventMetadata class, which provides access to event stream ID, version, position, and append ID from CloudEvent extensions, has been moved into the cloudevents-extension module. This change centralizes metadata handling for use across subscription, saga, projection, view, and DCB DSLs, ensuring consistent reading of event metadata regardless of the consumption path.
occurrent-cloudevents-extension · high confidence
Explicit activation required for Spring Boot MongoDB autoconfiguration
The MongoDB starter no longer autoconfigures itself simply by being on the classpath. Users must now annotate their Spring Boot application class with @EnableOccurrent to bootstrap the autoconfiguration. This change introduces the @EnableOccurrent annotation, which imports OccurrentMongoAutoConfiguration, and removes the previous implicit registration mechanism (including the now-deleted OccurrentMongoRegistrar). Additionally, the default transaction manager is now configured to use 'majority' read and write concerns, and the starter supports disabling the default ApplicationService instance or the event store/subscriptions via application properties.
framework/spring-boot-starter-mongodb · high confidence
Improved CloudEvent content-type detection for text and XML
The system now provides more robust detection of text-based CloudEvent payloads. A new internal helper class identifies text content types by checking for 'text/' prefixes as well as XML and CSV variants (e.g., '+xml', '+csv'), in addition to the existing JSON detection. This ensures that text-based event data is handled correctly according to the CloudEvent specification.
eventstore/mongodb/common/src/main/java/org/occurrent/eventstore/mongodb/cloudevent · high confidence
Improved concurrency error handling and version tracking in MongoDB event store
The MongoDB event store now correctly distinguishes between genuine duplicate CloudEvents and race conditions caused by concurrent writes to the same stream. A new \MongoExceptionTranslator\ detects MongoDB error code 112 (version conflict) and throws a \WriteConditionNotFulfilledException\ with the updated stream version, preventing misleading duplicate-key errors during parallel appends. Additionally, the \StreamVersionDiff\ class now exposes the \oldStreamVersion\ alongside the new version, providing clearer context for write condition failures.
eventstore/mongodb/common/src/main/java/org/occurrent/eventstore/mongodb/internal · high confidence
Improved reliability and responsiveness of MongoDB competing consumer lease management
The MongoDB competing consumer strategy now handles connection outages, clock skew, and shutdown scenarios more robustly. Lease refreshes are capped at five attempts to prevent a single slow or hanging operation from blocking other consumers on the same node, and the system now uses fencing tokens to ensure that only the current lease holder can act, preventing stale deliveries after a lease expires or is lost. Additionally, subscription notifications are delivered on separate threads to avoid blocking the main refresh loop, and the shutdown process no longer retries lease removal indefinitely when MongoDB is unreachable.
occurrent-subscription-mongodb-common-blocking-competing-consumer-strategy · high confidence
Introduce EventStoreCapability API for DCB and Stream modes
The event store now exposes an \EventStoreCapability\ enum to distinguish between standard stream-based operations and Dynamic Consistency Boundary (DCB) operations. This enables the system to stamp DCB-written events with a specific CloudEvent extension (\dcbtags\), allowing consumers to reliably identify and exclude DCB-tagged events from stream catch-up subscriptions. The API also applies JSpecify nullness defaults to the package.
common/eventstore-capability · high confidence
Introduce JSpecify null-safety annotations and rename SubscriptionPosition to Checkpoint
The MongoDB subscription base module now uses JSpecify annotations (e.g., @NullMarked, @Nullable) instead of JetBrains annotations to enforce null-safety across the API. Additionally, the internal concept of subscription position has been renamed from SubscriptionPosition to Checkpoint, introducing new concrete checkpoint types (MongoOperationTimeCheckpoint, MongoResumeTokenCheckpoint) and updating the storage logic to use a 'checkpoint' field instead of the legacy 'subscriptionPosition' field, while maintaining backward compatibility for reading older documents.
occurrent-subscription-mongodb-common-base · high confidence
Introduce configurable read and query options for the blocking Spring MongoDB event store
The blocking Spring MongoDB event store now allows you to separate read and query options via the new \queryOptions\ and \readOptions\ configuration properties. This enables distinct behaviors for transactional writes and non-transactional reads, such as allowing reads from secondaries for queries while keeping transactional reads on the primary. The configuration also introduces explicit control over global stream position writing, startup validation for unbackfilled positions, and detection of events damaged by pre-0.34.0 \updateEvent\ operations. Also in this area: Expanded event damage detection and stricter startup validation.
eventstore/mongodb/spring/blocking/src/main, occurrent-eventstore-mongodb-spring-blocking · high confidence
Introduced AfterRetryInfo and refactored MaxAttempts for retry strategy
The retry module now provides an AfterRetryInfo interface that exposes details about the state of a retry attempt, including whether it was successful or failed, the associated exception if any, and the backoff duration before the next attempt. Additionally, MaxAttempts has been refactored into a sealed interface with specific implementations (Limit and Infinite) to enforce stricter type safety and validation for maximum retry limits.
occurrent-retry · high confidence
MongoDB competing consumer strategy now uses fencing tokens and robust lease management
The MongoDB competing consumer strategy has been refactored to use a \MongoListenerLockService\ that implements fencing tokens, ensuring that stale handlers cannot overwrite newer state after a lease is lost or released. This change introduces a \LostLockException\ to signal when a lock is lost, fixes issues where lease removals would retry indefinitely during store outages, and ensures that lease version numbers do not reset to zero upon release, preventing race conditions between competing consumers.
subscription/mongodb/common/blocking/competing-consumer-strategy · high confidence
MongoDB store providers now enforce ID consistency and use bulk operations
The MongoDB store providers for projections, sagas, and snapshots have been updated to prevent silent read-model corruption and improve performance. Projection saves now verify that the state's @Id matches the projection key, failing fast with an IllegalStateException on mismatch instead of silently orphaning documents. Additionally, projection repositories now use real bulk operations for findAllById and saveAll, reducing database round trips.
occurrent-mongodb-spring-boot-starter · high confidence
Native MongoDB blocking subscription model introduces lifecycle-aware subscription handle and robust restart logic
The native MongoDB blocking subscription model now uses a new \NativeMongoSubscription\ record to expose subscription lifecycle state, allowing callers to wait for the change stream cursor to be acquired before processing events. This change accompanies significant behavioral improvements: subscriptions paused before their first event are no longer skipped upon resume, paused or cancelled subscriptions no longer continue delivering events after the change stream opens, and the model now automatically restarts on change-stream errors to ensure gap-free resumption. Additionally, subscriptions that resume from a checkpoint after being paused no longer skip events written during the pause, and transient MongoDB failures no longer prevent catch-up subscriptions from going live.
occurrent-subscription-mongodb-native-blocking · high confidence
Native MongoDB driver example updated to Java 21 patterns and CloudEvents 2.0
The native MongoDB driver example for the number-guessing game has been refactored to use modern Java features and updated dependencies. The serialization logic now uses Java 21 pattern matching for switch expressions to map CloudEvents to domain events, and the view model utilizes pattern matching in equals checks. Additionally, the codebase has been upgraded to use CloudEvents 2.0.0-milestone4 and Jackson 3, with the package structure renamed from se.haleby.occurrent to org.occurrent.
example-number-guessing-game-eventstore-mongodb-native · high confidence
Native blocking MongoDB checkpoint storage with conditional writes and first-checkpoint race resolution
The new NativeMongoCheckpointStorage implementation in the native blocking MongoDB module now evaluates CheckpointWriteConditions during saves, ensuring that fencing and write-integrity rules are enforced rather than ignored. It also introduces resolveFirstCheckpointRace to handle the initial subscription start race, comparing operation times to prevent skipping events on first delivery. These changes are backed by conformance tests against the standard CheckpointStorage contract and specific tests for the first-checkpoint race logic and legacy field migration.
subscription/mongodb/native/blocking-checkpoint-storage · high confidence
New MongoDB filter-to-BSON conversion logic with DCB stream exclusion
This change introduces the internal \ConditionConverter\ and \FilterToBsonFilterConverter\ classes that translate the library's \Condition\ and \Filter\ abstractions into MongoDB \Bson\ queries. The converter now supports single-operand conditions (equality, comparison, not-equal), multi-operand compositions (AND, OR, NOT), and an \In\ condition. Crucially, it implements a \CapabilityFilter\ that distinguishes between DCB and Stream events by checking for the existence of the \dcbTags\ field, effectively excluding DCB-tagged events from stream catch-up subscriptions without requiring a direct dependency on the DCB module.
common/mongodb/native/filter-bsonfilter-conversion · high confidence
New in-memory filter matching engine with optimized AND short-circuiting
The in-memory event store now uses a dedicated filter-matching module (ConditionMatcher, FilterMatcher, PayloadConditions) to evaluate CloudEvent filters. This implementation introduces strict left-to-right short-circuiting for AND filters, ensuring that metadata checks fail fast before any event payload is parsed, and batches consecutive data-field reads into a single payload access to avoid repeated reparsing. It also adds robust numeric comparison (comparing numbers by value regardless of Java type), supports querying by fields inside the event payload, and correctly handles DCB-tagged events in stream catch-up subscriptions.
common/inmemory/filter-matching/src/main/java/org/occurrent/inmemory · high confidence
New internal filter-to-query conversion logic for MongoDB
This change introduces the internal implementation classes (ConditionToCriteriaConverter, FilterConverter) that translate the library's abstract Filter and Condition models into Spring Data MongoDB Query and Criteria objects. It enables users to query event stores using the standard filter API, with specific support for excluding DCB-tagged events from stream catch-up subscriptions by checking the presence of the 'dcbTags' field, and modernizes the codebase by using Java sealed interfaces and pattern matching for the conversion logic.
common/mongodb/spring/filter-query-conversion · high confidence
New internal validators for stream read filters and event data integrity
This change introduces a set of internal validation classes in the eventstore API to enforce stricter data integrity and filter rules. StreamReadFilterValidator and StreamReadFilterToFilterMapper now validate and map stream read filters, preventing users from constraining reserved Occurrent fields like streamId and streamVersion. Additionally, startup checks have been standardized via PositionBackfillValidator, UpdateEventRepairValidator, and UpdateEventFunctionValidator to detect and warn about or block startup for events damaged by pre-0.34.0 updateEvent bugs, missing position fields, or null update functions, ensuring consistent error messaging across all event store implementations.
eventstore/api/common/src/main/java/org/occurrent/eventstore/api/internal · high confidence
New subscription tuning, checkpoint, and deduplication APIs
The subscription core now exposes explicit configuration and type definitions that change how subscriptions are started, checkpointed, and deduplicated. Users can tune the catch-up-to-live handover via the new CatchupThenLiveOptions record, which sets the deduplication cache size and the maximum buffered events before failing loud. Checkpoint handling is unified through the Checkpoint interface and its GlobalCheckpoint and StringBasedCheckpoint implementations, allowing subscriptions to resume from specific sequence positions. Checkpoint writes now support conditional logic via CheckpointWriteCondition (any, notOlderThan, ifAbsent), enabling safer concurrent writes and preventing negative version issues in Redis. Additionally, DCB-specific start positions are defined in DcbStartAt, and internal deduplication is consolidated into the thread-safe BoundedIdCache to handle replay-to-live overlap.
occurrent-subscription-core · high confidence
Number Guessing Game model modernized with Java records and null-safety annotations
The number-guessing-game model has been refactored to use modern Java features: domain events (such as NumberGuessingGameWasStarted, PlayerGuessedTheRightNumber, and GuessingAttemptsExhausted) are now implemented as Java records instead of classes, and value objects like Guess and MaxNumberOfGuesses use pattern matching in instanceof checks. Additionally, JSpecify nullness annotations (e.g., @Nullable) have been added across the model classes to improve null-safety, and Apache 2 license headers have been inserted into all files.
example-number-guessing-game-model · high confidence
Optimized JSON field reading for multi-leaf filters
The Jackson-based data field reader now supports reading multiple JSON paths in a single pass via the new \readAll\ method. This change eliminates the previous behavior where complex filters with multiple conditions (leaves) on the same event triggered repeated, expensive re-parses of the JSON payload. Users benefit from significantly improved query performance, especially for filters that access several fields from the same event, as the underlying JSON is now parsed only once regardless of how many fields are requested.
common/inmemory/filter-matching-jackson, occurrent-common-inmemory-filter-matching-jackson · high confidence
Optimized bulk read and write operations for Mongo-backed view repositories
The library now uses dedicated bulk operations for loading and saving view states in MongoDB, significantly reducing database round trips during batch replays. The new \MongoBulkViewStateOperations\ implementation replaces the previous loop-based approach with a single \findAllById\ query using an \$in\ filter and a \saveAll\ method that groups writes into unordered bulk operations. This change preserves existing behavior, including optimistic locking checks for versioned entities and proper exception translation for duplicate keys, but delivers these results with improved performance for bulk data processing.
dsl/view-dsl/src/main/java/org/occurrent/dsl/view/internal · high confidence
Projection filter derivation and metadata-key validation moved to internal utilities
The logic for deriving the event filter a projection selects on and the validation for metadata-based view-instance keys have been consolidated into new internal classes, ProjectionFilters and ProjectionKeys. ProjectionFilters centralizes the filter resolution so that an explicit filter takes precedence, while missing filters are derived from declared event types using the same expansion logic as sagas and subscriptions, ensuring consistent type handling. ProjectionKeys introduces a safety check that throws an IllegalStateException if a projection keyed by event metadata receives an event with empty metadata, preventing silent event drops that previously occurred when metadata was folded away.
dsl/projection-dsl/common/src/main/java/org/occurrent/dsl/projection/internal · high confidence
Reactive MongoDB subscription model delivers events written during pause and handles resume correctly
The new ReactorMongoSubscriptionModel in the Spring Reactor module fixes event delivery gaps: subscriptions paused before their first event now resume without skipping subsequent events, and subscriptions started at the present no longer miss events written immediately after subscribe returns, even if the server clock moves forward. This is achieved via DriverChangeStreamCursor to read the driver's internal resume token and KnownClusterTime to track the driver's cluster time, with ReactorMongoSubscriptionModelConfig allowing users to configure exponential backoff and optional automatic restart when change stream history is lost.
subscription/mongodb/spring/reactor · high confidence
Reactive projection feed performance and metadata handling improvements
The reactor projection DSL now uses a new CatchupProjectionFeed that delivers domain events directly to the live path without CloudEvent conversion overhead, while replayed events are coalesced per key during catch-up to reduce database round trips. Projections can now access event metadata during both replay and live processing, enabling metadata-keyed projections to resolve instances consistently across the catch-up and live phases. The ReactiveDcbProjectionRunner provides a reactive counterpart to the blocking DCB projection runner, supporting subscription-based event processing with metadata awareness.
occurrent-projection-dsl-reactor · high confidence
Reactive subscription model API reshaped with lifecycle management and DCB support
The reactive subscription API has been restructured to introduce named, lifecycle-managed subscriptions alongside the existing bare Flux primitives. New interfaces such as Subscribable and CancellableSubscriptions allow subscriptions to be tracked by ID, enabling explicit pause, resume, and cancel operations, while the new DcbSubscriptionModel provides a typed view for subscribing to Domain Change Boundary (DCB) events using specific criteria. The CheckpointStorage interface has been enhanced with conditional write support (CheckpointWriteCondition) and race-resolution capabilities to ensure robust checkpointing, and the framework now includes ResumeStartPositions to simplify the pattern of replaying history on first run and resuming from a checkpoint on subsequent runs.
subscription/api/reactor · high confidence
Reactor durable subscription model now refuses unresolvable start positions and supports opt-in override
The Reactor durable subscription model now explicitly refuses a subscription registration when the start position cannot be resolved (e.g., no checkpoint stored and the wrapped model's global checkpoint is empty), rather than silently skipping events or falling back to an undefined position. This refusal is thrown immediately when the wrapped model manages named subscriptions, or signaled on the subscription handle when the durable model drives the cold primitive itself. Users can opt-in to bypass this refusal and start the subscription anyway (accepting a potential loss window) by setting \startWhenNoStartPositionCanBeRecorded\ to \true\ in \ReactorDurableSubscriptionModelConfig\. Additionally, the model now uniformly composes with both named subscription models and plain catch-up models, ensuring consistent lifecycle management and error handling across both paths.
subscription/util/reactor/durable-subscription · high confidence
ReactorMongoEventStore now supports non-transactional reads and configurable query options
The ReactorMongoEventStore has been updated to support non-transactional reads, allowing you to configure separate read and query options. This enables scenarios where queries can read from secondaries while standard reads remain on the primary. The EventStoreConfig now exposes queryOptions and readOptions fields, along with new configuration flags like requireRepairedEvents and requireBackfilledPosition to control startup behavior regarding damaged or un-backfilled events.
eventstore/mongodb/spring/reactor/src/main · high confidence
Redis checkpoint storage now supports conditional writes and Redis Cluster compatibility
The Spring Redis checkpoint storage now evaluates \CheckpointWriteCondition\ (specifically \notOlderThan\ and \ifAbsent\) using atomic Lua scripts, ensuring fencing and idempotency without race conditions. It also introduces a dedicated version key to store fencing tokens, allowing multiple subscriptions to coexist safely. The implementation is fully compatible with Redis Cluster by using hash tags to keep checkpoint and version keys on the same slot, and it includes a fallback mechanism for delete operations that may cross slots. Standalone mode accepts all subscription IDs, while Cluster mode refuses IDs that would cause slot collisions to maintain data integrity.
subscription/redis/spring/blocking-checkpoint-storage · high confidence
Refactored blocking subscription API with lifecycle contracts and capability interfaces
The blocking subscription API has been restructured to enforce a unified lifecycle contract and modular capabilities. All blocking subscription models now implement the SubscriptionModelLifeCycle interface, standardizing start, stop, pause, resume, and shutdown behaviors. A new Subscribable interface consolidates subscription registration methods, while specific capabilities like CancellableSubscriptions, CheckpointAwareSubscriptionModel, and HistoryRetainingSubscriptions are exposed as distinct interfaces. The API introduces DcbSubscriptionModel for typed Dynamic Consistency Boundary subscriptions and ManualStartSubscriptionModel for deferred subscription activation. Checkpoint storage now supports conditional writes via CheckpointWriteCondition and fencing tokens through CheckpointWriteVersionSource, improving reliability in competing consumer scenarios. Null-safety is enforced via JSpecify annotations across the API.
subscription/api/blocking · high confidence
Refactored filter and condition APIs to use sealed interfaces and records
The event filtering and condition logic in the \occurrent-filter\ module has been refactored to use Java sealed interfaces (\Condition\ and \Filter\) and record classes for their implementations. This structural change enforces a closed hierarchy for condition types (such as \SingleOperandCondition\, \InOperandCondition\, and \MultiOperandCondition\) and filter types (including \SingleConditionFilter\, \CompositionFilter\, and \CapabilityFilter\). For users, this represents a behavioral change in how filters are composed and matched, particularly introducing a \CapabilityFilter\ that allows filtering events by their write capability (e.g., distinguishing between DCB-tagged events and stream-written events), and supports querying the \data\ attribute directly. The API now relies on immutable record structures for conditions and filters, replacing previous mutable or open-interface designs.
occurrent-filter · high confidence
Refactored word guessing game into feature-based structure with new gameplay views
The word guessing game example has been reorganized into a feature-based architecture, introducing new use cases for starting games and making guesses, along with dedicated read models and MongoDB views for tracking ongoing and ended games. This change adds specific components to display lists of active and completed games, allowing users to see game status and results directly within the application interface.
example/domain/word-guessing-game/mongodb/spring/blocking/src/main/kotlin/org/occurrent/example/domain/wordguessinggame/mongodb/spring/blocking/features/gameplay · high confidence
Reflection-based CloudEvent type mapping now supports simple and qualified class names
The reflection-based CloudEvent type mapper in the \application/cloudevent-type-mapper/reflection\ module has been refactored to use a new \ClassName\ sealed interface, allowing users to configure whether cloud event types are represented by the simple class name (with an optional package prefix) or the fully qualified class name. This change introduces \ReflectionCloudEventTypeMapper\ with static factory methods (\simple\, \qualified\) to select the mapping strategy, and adds nullness defaults via JSpecify annotations to the package.
application/cloudevent-type-mapper/reflection · high confidence
Retry loop now respects shutdown signals during backoff sleep
The retry mechanism in the internal execution engine now polls the shutdown predicate every 50 milliseconds while waiting out a backoff period. Previously, a shutdown signal issued during a long backoff would only be detected after the full sleep duration elapsed; now, the loop can terminate immediately at the next poll, preventing unnecessary delays and ensuring that shutdown requests are honored promptly even when retries are configured with long backoff intervals.
common/retry/src/main/java/org/occurrent/retry/internal · high confidence
Retry strategy API restructured with new lifecycle hooks and sealed types
The retry module's API has been significantly restructured to provide more granular control and better null-safety. The \RetryStrategy\ interface now exposes new lifecycle hooks: \onBeforeRetry\ and \onAfterRetry\ allow actions to be performed before and after each retry attempt, while \onRetryableError\ and \mapError\ enable custom handling and transformation of retryable errors. The \BiConsumer\ arguments for these hooks have been standardized to \BiConsumer\<Throwable, RetryInfo\>\. Additionally, core configuration types like \Backoff\ and \MaxAttempts\ have been converted to sealed interfaces with record implementations, and the entire module is now annotated with JSpecify \@NullMarked\ to enforce null-safety contracts.
common/retry/src/main/java/org/occurrent/retry · high confidence
Spring MongoDB blocking subscription model refactored with lifecycle support and new executor
The Spring MongoDB blocking subscription model has been refactored to implement the SubscriptionModelLifeCycle interface, enabling explicit start, stop, and pause/resume capabilities for subscriptions. The internal execution strategy has been updated to use a ThreadPoolTaskExecutor instead of the previous SimpleAsyncTaskExecutor, and the model now supports creating subscriptions in a stopped state. Additionally, the SpringMongoSubscription class was introduced to handle subscription state and waiting logic, and null-safety annotations from jspecify have been applied across the module.
occurrent-subscription-mongodb-spring-blocking · high confidence
Startup validation for competing-consumer checkpoint fencing and manual start for push subscriptions
The blocking Spring Boot autoconfigure module now validates checkpoint fencing configuration at startup, refusing to start if the competing-consumer strategy and checkpoint storage cannot work together, rather than failing silently later. Additionally, a new manual start mode allows push-based projections and sagas to be registered without automatically starting their catch-up, giving applications control over when these background processes begin.
occurrent-blocking-spring-boot-autoconfigure · high confidence
Strict validation of natural sort order in MongoDB queries
The MongoDB Spring integration now enforces stricter rules when converting sort specifications. A new internal converter rejects attempts to combine a natural sort step with other sort steps, throwing an IllegalArgumentException instead of silently degrading the query. This prevents incoherent compound sorts and ensures compatibility with MongoDB 7.0+, which rejects $natural in compound sort contexts. Additionally, the package is marked with JSpecify nullness defaults.
common/mongodb/spring/sort-conversion · high confidence
Stricter event-type expansion prevents silent event loss
The filter module now enforces a rule that a declared event type must name every concrete subtype dispatch would accept. Previously, declaring a non-final concrete class or certain Kotlin enum structures could silently miss events; the new EventTypeExpansion logic refuses these hierarchies instead of building a filter that would drop them. This ensures that sagas, projections, subscriptions, and queries receive all expected events, or fail fast with a clear error if the hierarchy cannot be fully enumerated.
common/filter · high confidence
Unified catch-up subscription model with DCB support and improved handover reliability
The blocking catch-up subscription model now supports both stream-based and Data-Centric Business (DCB) event stores through a single dispatcher that routes subscriptions to the appropriate replay path. For DCB stores, historic events are replayed by position rather than time, and the model captures the live resume token before the bulk replay to prevent event loss during the handover to live processing. The implementation introduces a shared state mechanism to coordinate handovers across different subscription types, ensuring that lifecycle operations like stop, start, and cancel are propagated exactly once to the underlying subscription model. Additionally, the model now defaults to subscribing live without replaying history unless explicitly started from the beginning of time, and it includes robust handling for clock skew and oplog window limits to fail loudly rather than silently dropping events.
subscription/util/blocking/catchup-subscription · high confidence
Unified partial function application for commands
The command-composition module now provides a single, generic \PartialFunctionApplication\ utility that replaces the previous \PartialListCommandApplication\, \PartialStreamCommandApplication\, and \PartialApplicationFunctions\. This new class supports partial application for functions with up to 13 parameters, allowing developers to bind arguments to domain functions regardless of whether they operate on \List\ or \Stream\ inputs. Additionally, the package has been annotated with JSpecify nullness defaults (\@NullMarked\) to improve null-safety across the API.
application/command-composition/src/main/java/org/occurrent/application/composition/command/partial · high confidence
Unified subscription filtering logic for stream and capability-agnostic subscriptions
The subscription DSL now uses a shared \SubscriptionFilters\ module to build event filters, supporting both \StreamSubscriptionFilter\ and \AgnosticSubscriptionFilter\. This logic automatically expands sealed event types to include all concrete subtypes, matches all events when no types are declared, and rejects abstract or primitive types with clear error messages. This ensures consistent filtering behavior across blocking and reactive subscription implementations.
dsl/subscription-dsl/common · high confidence
Updated number-guessing-game example to use @StreamSubscription and new package structure
The blocking Spring example for the number-guessing game has been refactored to use the new @StreamSubscription annotation (renamed from @Subscription) and the updated org.occurrent package structure. The integration event handler now subscribes to domain events to publish a completed game event, and the view model has been updated to reflect the new GameState structure (Ongoing/Ended).
example-number-guessing-game-eventstore-mongodb-spring-blocking · high confidence
Word guessing game model introduces dash support and read model assembly
The word guessing game model now supports words containing dashes (e.g., 'One-Two') as valid characters, replacing previous whitespace handling. A new read model assembly component (\AssembleGameReadModelFromDomainEvents\) has been added to reconstruct game state from domain events, ensuring that dashes in the target word are preserved in the hint display rather than being obfuscated. The model also includes comprehensive property-based and unit tests for word validation, point calculation, and hint character revelation logic.
example/domain/word-guessing-game/model · high confidence
Fixes
Fixes command composition to prevent accidental inclusion of previous events
The internal command composition logic has been corrected to ensure that generated composition functions no longer accidentally include 'previous events' when invoked. This change, implemented via new internal utilities like CreateListFromVarArgs and SequentialFunctionComposer, ensures that command sequences operate on the correct event state, resolving bugs where prior events were incorrectly propagated into subsequent command executions.
application/command-composition/src/main/java/org/occurrent/application/composition/command/internal · high confidence
MongoDB time filters now match legacy variable-width date strings
The MongoDB event store now correctly finds events when querying by the \time\ field, even if those events were written before the system upgraded to the fixed-width RFC-3339 format. Previously, equality checks (e.g., finding an event at a specific instant) would silently miss older events because their timestamps were stored in a variable-width format. This change introduces special handling that matches both the new canonical format and the legacy \OffsetDateTime.toString()\ output for equality and inequality conditions, ensuring seamless cross-store compatibility without affecting range queries.
common/mongodb/specialfilterhandling/src/main · high confidence
Reactor stream catch-up subscriptions now use (id, source) deduplication to prevent event loss
The stream catch-up subscription model now deduplicates replayed events against live events using both the CloudEvent id and source, rather than the id alone. This prevents a live event from a different producer (sharing only an id with a replayed event) from being incorrectly suppressed. The change also introduces a larger default handover cache (100,000 events) and a snapshot-bounded reconciliation phase to prevent livelocks during sustained writes, ensuring that events written during the replay are delivered in order without being dropped or causing the subscription to hang. Also in this area: Improved robustness for competing-consumer subscriptions and history-loss reporting; Fix for blocking calls in Reactor non-blocking threads during late bean registration.
subscription/util/reactor/stream-catchup-subscription · high confidence
Test coverage
11 commits adding/updating tests in dsl/saga-dsl/common/src/test/java/org/occurrent/dsl/saga/docs, dsl/saga-dsl/common/src/test/kotlin/org/occurrent/dsl/saga/docs; 3 commits adding/updating tests in eventstore/api/dcb/src/test/java/org/occurrent/eventstore/api/dcb/internal; 4 commits adding/updating tests in dsl/projection-dsl/blocking/src/test/kotlin/org/occurrent/dsl/projection/blocking/docs; 5 commits adding/updating tests in dsl/projection-dsl/blocking/src/test/java/org/occurrent/dsl/projection/blocking/docs; 5 commits adding/updating tests in eventstore/mongodb/common/src/test/java/org/occurrent/eventstore/mongodb/internal; 5 commits adding/updating tests in eventstore/mongodb/dcb-common/src/test; Added Kotlin tests for JacksonCloudEventConverter; Added Kotlin unit tests for RetryStrategy; Added TCK conformance and integration tests for the Reactor MongoDB event store; Added comprehensive test coverage for SpringMongoEventStore; Added conformance tests and nullness annotations for the blocking MongoDB competing consumer strategy; Added integration tests and local bootstrap for the course-enrollment example; Added test coverage for the blocking DCB DSL; Added test suite for blocking DSL module configuration and event modeling; Added test support classes for event counting and aggregation; Added tests for CloudEvent serialization and content-type handling; Added tests for DCB application service extensions and execute options; Added tests for DCB decider application service and domain event queries; Added tests for DCB domain patterns; Added tests for DCB pattern examples; Added tests for DCB tag generation and query helpers in the word-guessing-game example; Added tests for DCB-integrated gameplay use cases and concurrency handling; Added tests for DeciderApplicationService and Decider.evolve; Added tests for DomainEventQueries Kotlin extension functions; Added tests for DomainEventQueries in the blocking Query DSL; Added tests for ExecuteFilter and ExecuteOptions in the blocking application service; Added tests for ExecuteOptions configuration and equality; Added tests for Jackson CloudEventConverter; Added tests for JobRunr deadline scheduling; Added tests for Kafka CloudEvent broker reliability and correctness; Added tests for Kotlin blocking application service helpers and typed filters; Added tests for Kotlin snapshot view DSL and Java builder nullability; Added tests for MongoDB flush and cleanup utilities; Added tests for MongoDB saga state store reliability and compatibility; Added tests for RFC-3339 time filter handling across legacy and canonical formats; Added tests for RabbitMQ Spring Boot starter auto-configuration and readiness logic; Added tests for RabbitMQ blocking broker reliability and error handling; Added tests for RetryStrategy shutdown predicates and error mapping; Added tests for SubscriptionModel capability lookups; Added tests for View DSL bulk operations, metadata handling, and optimistic locking; Added tests for View metadata handling and ViewStateRepository defaults; Added tests for XStream-based CloudEvent converter; Added tests for blocking projection DSL contract and replay behaviors; Added tests for blocking projection DSL runners; Added tests for blocking saga DSL subscription filters, timeouts, and quarantine behavior; Added tests for command dispatching and forwarding logic; Added tests for decider application service extensions, combinators, and core logic; Added tests for default subscription ID derivation and subscription model capabilities; Added tests for event store position validation and stream read filter mapping; Added tests for gameplay use cases and read model projections; Added tests for in-memory deadline registry shutdown and error handling; Added tests for internal Saga DSL execution, filtering, and quarantine logic; Added tests for list command composition and partial application; Added tests for multi-command decider processing in Rock Paper Scissors example; Added tests for projection filter derivation and applied-append recording concurrency; Added tests for reactive DCB application service options and execution; Added tests for reactive snapshot deciders and views; Added tests for reactor projection DSL catch-up, replay, and metadata handling; Added tests for retry loop shutdown and backoff behavior; Added tests for sagas issuing domain functions via Invocation; Added tests for snapshot DSL components; Added tests for synchronous subscriptions in the blocking application service; Added tests for the Flow Saga DSL; Added tests for the FlowSaga Java DSL and step condition logic; Added tests for the Projection DSL and AppliedAppendStore; Added tests for the RPS model application service and view demos; Added tests for the Reactor projection DSL and DCB metadata handling; Added tests for the Saga DSL core components; Added tests for the Saga DSL extension functions; Added tests for the blocking DCB DSL and decider extensions; Added tests for the blocking JUnit Jupiter subscription extension; Added tests for the blocking broker API foundation; Added tests for the new reactive JUnit 5 subscription extension; Added tests for the reactive DCB DSL and subscriptions; Added tests for the reactive Domain Event Queries DSL; Added tests for the reactive GenericApplicationService; Added unit tests for event store API components; Added unit tests for in-memory filter matching and data field reading; Added unit tests for the Dynamic Consistency Boundary (DCB) API; In-memory event store now runs full TCK conformance suites; Native MongoDB event store gains comprehensive test coverage; New conformance test suite for blocking subscription models; New reactive TCK conformance suites and fixtures for subscription models and checkpoint storage; Spring Boot testing module adds @EnableOccurrentTesting annotation and auto-configuration.
Dependencies
New CloudEvent converter and type-mapper modules
The project introduces new Maven modules for serializing domain events to and from CloudEvents. The \cloudevent-converter\ module provides implementations for Jackson, Jackson 3, and XStream, while the \cloudevent-type-mapper\ module offers a reflection-based type mapper. These modules rely on the \jspecify\ library for null-safety annotations and the \cloudevents-api\ and \cloudevents-core\ libraries for CloudEvents support.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 67 → 66 (-0.8)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 87 → 87 (+0.1)
- Architecture 83 → 82 (-1.2)
- Maturity 77 → 84 (+7.3)
- Readiness 53 → 51 (-2.1)
- Security 82 → 74 (-8.4)
- Performance 78 → 91 (+13.6)
Resolved (232)
- 9562.visitMethodDeclaration (cognitive 24) (rewrite/src/main/java/org/occurrent/rewrite/MigrateReactorCancelSubscriptionReturnType.java)
- 9562.visitMethodDeclaration (cyclomatic 19) (rewrite/src/main/java/org/occurrent/rewrite/MigrateReactorCancelSubscriptionReturnType.java)
- ADR not followed: 43. Reactive MongoDB subscription lifecycle parity (doc/architecture/decisions/0043-reactive-mongodb-subscription-lifecycle-parity.md)
- ADR not followed: 53. DCB API freeze consistency pass (doc/architecture/decisions/0053-dcb-api-freeze-consistency.md)
- ADR not followed: 69. Programmatic snapshot API: global facade plus per-aggregate spec (doc/architecture/decisions/0069-programmatic-snapshot-facade-and-per-aggregate-spec.md)
- Boundary-crossing change coupling: SagaRunnerConfig.java ↔ OccurrentProperties.java (dsl/saga-dsl/blocking/src/main/java/org/occurrent/dsl/saga/blocking/SagaRunnerConfig.java)
- Change coupling: SpringMongoCheckpointStorage.java ↔ SpringMongoSubscriptionModel.java (subscription/mongodb/spring/blocking-checkpoint-storage/src/main/java/org/occurrent/subscription/mongodb/spring/blocking/SpringMongoCheckpointStorage.java)
- Checkable ADR rule enforced only by prose: 133. A broker is a transport for the push feed, and never a subscription model (doc/architecture/decisions/0133-a-broker-is-a-transport-for-the-push-feed-and-never-a-subscription-model.md)
- Checkable ADR rule enforced only by prose: 134. A saga instance that keeps failing is quarantined at its own position (doc/architecture/decisions/0134-a-saga-instance-that-keeps-failing-is-quarantined-at-its-own-position.md)
- Checkable ADR rule enforced only by prose: 71. Relocate EventMetadata to cloudevents-extension (doc/architecture/decisions/0071-relocate-eventmetadata-to-cloudevents-extension.md)
- Checkable ADR rule enforced only by prose: 94. The subscription TCK declares three differences, and waits deterministically (doc/architecture/decisions/0094-the-subscription-tck-declares-three-differences-and-waits-deterministically.md)
- Consequences are only one sentence and the trade-off of reading operation time instead of a resume token is not stated (doc/architecture/decisions/0005-mongodb-subscription-implementation.md)
- Context and consequences are present but only one (consequences) is named; the body is mostly status notes with no context/problem statement (doc/architecture/decisions/0134-a-saga-instance-that-keeps-failing-is-quarantined-at-its-own-position.md)
- Decision is 'None yet' with no consequences and no context (why CloudEvent serialization matters for Occurrent) (doc/architecture/decisions/0002-mongodb-cloudevent-serialization.md)
- Dependency hygiene PARTLY measured — Maven/Gradle declarations read, no dependency graph resolved
- Duplicated block (10 lines × 2) (broker/rabbitmq/blocking/src/main/java/org/occurrent/broker/rabbitmq/blocking/RabbitMqCloudEventSource.java)
- Duplicated block (10–11 lines × 2) (dsl/snapshot-dsl/reactor/src/main/java/org/occurrent/dsl/snapshot/reactor/ReactiveSnapshotDcbDeciderApplicationService.java)
- Duplicated block (11 lines × 2) (eventstore/mongodb/spring/blocking/src/main/java/org/occurrent/eventstore/mongodb/spring/blocking/EventStoreConfig.java)
- Duplicated block (14 lines × 2) (broker/rabbitmq/blocking/src/main/java/org/occurrent/broker/rabbitmq/blocking/RabbitMqCloudEventSource.java)
- Duplicated block (14 lines × 2) (subscription/mongodb/common/blocking/change-stream/src/main/java/org/occurrent/subscription/mongodb/blocking/changestream/internal/ChangeStreamSubscriptions.java)
- …and 212 more
New (206)
- 9729.visitMethodDeclaration (cognitive 24) (rewrite/src/main/java/org/occurrent/rewrite/MigrateReactorCancelSubscriptionReturnType.java)
- 9729.visitMethodDeclaration (cyclomatic 19) (rewrite/src/main/java/org/occurrent/rewrite/MigrateReactorCancelSubscriptionReturnType.java)
- Banned license: org.openjdk.jmh:jmh-core
- Banned license: org.openjdk.jmh:jmh-generator-annprocess
- ChangeStreamSubscriptions.start (cognitive 16) (subscription/mongodb/common/blocking/change-stream/src/main/java/org/occurrent/subscription/mongodb/blocking/changestream/internal/ChangeStreamSubscriptions.java)
- ClassTooLong: DcbMarkerVersionsConformance (tck/eventstore-blocking/src/main/java/org/occurrent/tck/eventstore/blocking/DcbMarkerVersionsConformance.java)
- ClassTooLong: MongoLeaseCompetingConsumerStrategySupport (subscription/mongodb/common/blocking/competing-consumer-strategy/src/main/java/org/occurrent/subscription/mongodb/blocking/ccs/internal/MongoLeaseCompetingConsumerStrategySupport.java)
- ClassTooLong: NamedCatchupSupport (subscription/util/reactor/stream-catchup-subscription/src/main/java/org/occurrent/subscription/reactor/durable/catchup/NamedCatchupSupport.java)
- ClassTooLong: RabbitMqCloudEventSource (broker/rabbitmq/blocking/src/main/java/org/occurrent/broker/rabbitmq/blocking/RabbitMqCloudEventSource.java)
- ClassTooLong: RabbitMqDomainEventSource (broker/rabbitmq/blocking/src/main/java/org/occurrent/broker/rabbitmq/blocking/domain/RabbitMqDomainEventSource.java)
- DcbAppendConditionCheck.check (cognitive 20) (eventstore/mongodb/dcb-common/src/main/java/org/occurrent/eventstore/mongodb/dcb/internal/DcbAppendConditionCheck.java)
- DcbMarkerVersionsSupport.requireResumable (cognitive 19) (eventstore/api/dcb/src/main/java/org/occurrent/eventstore/api/dcb/internal/DcbMarkerVersionsSupport.java)
- Dependency hygiene PARTLY measured — Maven build resolved part of the dependency graph, currency reported but not scored
- Documentation: no build, run or usage example (README.md)
- Duplicated block (10 lines × 2) (broker/rabbitmq/blocking/src/main/java/org/occurrent/broker/rabbitmq/blocking/RabbitMqCloudEventSource.java)
- Duplicated block (10 lines × 2) (broker/rabbitmq/blocking/src/main/java/org/occurrent/broker/rabbitmq/blocking/RabbitMqCloudEventSource.java)
- Duplicated block (10 lines × 2) (broker/rabbitmq/blocking/src/main/java/org/occurrent/broker/rabbitmq/blocking/RabbitMqCloudEventSource.java)
- Duplicated block (10 lines × 2) (tck/eventstore-blocking/src/main/java/org/occurrent/tck/eventstore/blocking/DcbLateCommitConformance.java)
- Duplicated block (10 lines × 3) (eventstore/mongodb/native/src/main/java/org/occurrent/eventstore/mongodb/nativedriver/EventStoreConfig.java)
- Duplicated block (10 lines × 3) (tck/eventstore-blocking/src/main/java/org/occurrent/tck/eventstore/blocking/DcbEventStoreConformance.java)
- …and 186 more
Changes since last survey
- 55 commits — 51 feature/other, 4 fixes
By area
- subscription/util — 12 commits
- doc/architecture — 6 commits
- eventstore/mongodb — 6 commits
- framework/spring-boot-autoconfigure — 5 commits
- subscription/mongodb — 5 commits
- (root) — 3 commits
- broker/kafka — 3 commits
- dsl/saga-dsl — 2 commits
- eventstore/api — 2 commits
- tck/eventstore-blocking — 2 commits
- application/cloudevent-converter — 1 commit
- application/service — 1 commit
- broker/rabbitmq — 1 commit
- dsl/projection-dsl — 1 commit
- dsl/snapshot-dsl — 1 commit
- eventstore/migration — 1 commit
- framework/spring-boot-starter-mongodb — 1 commit
- rewrite/src — 1 commit
- subscription/api — 1 commit
Notable commits
- fix: Consume again after a RabbitMQ connection recovery and fix the failure paths around it (#1341)
- fix: Fix a deadlock when a dynamic start cancels another reactor catch-up subscription (#1380)
- fix: Fix the lease race test in the competing consumer model failing under CI load (#1337)
- fix: Make the dcbTags startup warning fix several unusable indexes (#1306)
- change: A MongoDB lease refresh stopped for good after an Error, with nothing logged (#1334)
- change: A competing consumer logged a pause its wrapped model refused at DEBUG (#1345)
- change: A heap OutOfMemoryError in a MongoDB lease refresh could lose a lease grant or prohibition (#1360)
- change: A second push projection on one feed left a broker source paused under manual start (#1286)
- change: A subscription model can declare that it delivers in commit order (#1366)
- change: A subscription stopped getting lease grants after the notifier threw an Error (#1347)
- change: ADR 147: a DCB token knows the criteria it was read with, and tagged criteria stop conflicting on a type (#1299)
- change: Accept an interrupt inside a driver call as well as in the throttle sleep in the repair test (#1333)
- change: Add ADR 148 on the complete-through position (#1301)
- change: Add ADR 152 on the dcbTags startup check (#1308)
- change: Add TCK suites that show a late lower append being missed (#1312)
- change: Add restart tests that show a late lower commit being skipped (#1313)
- change: Add the 0.35.0 changelog heading, migration guide and recipe scaffolding (#1295)
- change: Added claude to gitgnore [ci skip]
- change: Apply a saga stream version delivered after a higher one (#1309)
- change: Ask a blocking start-position function with no lock for its id held (#1403)
- …and 35 more
Architecture
- Containers 0 added · 0 removed · contexts 2 added · 0 removed · edges 6 added · 0 removed
Added bounded contexts (2)
- occurrent-eventstore-mongodb-dcb-common
- occurrent-eventstore-mongodb-spring-blocking
Added dependency edges (6)
- occurrent-eventstore-mongodb-native → occurrent-eventstore-mongodb-dcb-common
- occurrent-eventstore-mongodb-spring-blocking → occurrent-filter
- occurrent-eventstore-mongodb-spring-reactor → occurrent-eventstore-mongodb-dcb-common
- occurrent-mongodb-spring-boot-starter → occurrent-eventstore-mongodb-spring-blocking
- occurrent-subscription-core → occurrent-cloudevents-extension
- occurrent-tck-subscription-blocking → occurrent-tck-common
Written by cca.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 9 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit deee22e63e884e7724baa0811c5b2ee96a8947ee — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.4+preprod-464a0040a931.