Skip to content

Instantly share code, notes, and snippets.

View markuseckstein's full-sized avatar

Markus markuseckstein

  • Bavaria, Germany
View GitHub Profile

Spring Modulith Event Batch Processing: Produktionsreife Optimierungsstrategien

Spring Modulith bietet keine nativen Batch-Publishing-APIs für die gleichzeitige Verarbeitung tausender Events. Die Architektur ist fundamental auf einzelne Event-Publikation ausgelegt, wobei jedes Event separat durch das Event Publication Registry läuft und in MongoDB persistiert wird. Dennoch lassen sich durch gezielte Architekturmuster, MongoDB-Optimierungen und moderne Java-Features Durchsatzsteigerungen von 50-200x erreichen. Bei korrekter Implementierung können Systeme 10,000-20,000 Events pro Sekunde verarbeiten Medium - ausreichend für die meisten produktiven High-Volume-Szenarien.

Die zentrale Herausforderung bei 1000 Kafka Messages liegt im Transactional Outbox Pattern von Spring Modulith: Jedes gepublishte Event erzeugt separate Einträge in der EVENT_PUBLICATION Collection für jeden registrierten Listener. [Medium +3](https://medium.com/@srdjan

@markuseckstein
markuseckstein / event-sourcing-spring-mongo.md
Created October 24, 2025 08:20
How to build a event sourcing system with spring and mongo

Building Production-Ready Event Sourcing with Spring Boot and MongoDB

MongoDB can serve as an effective event store for event sourcing when properly architected, offering single-document atomicity, horizontal scalability, and flexible schema evolution—though it requires more application-level code compared to purpose-built stores like EventStoreDB. This guide synthesizes production patterns from MongoDB's documentation, Spring Boot practitioners, and real-world implementations to help you build a robust system with event-based snapshotting, eventual consistency, and automatic projections for RechnungswesenGeschaeftspartner and Personenkonto aggregates.

Stream-as-document pattern delivers optimal consistency and performance

The most effective MongoDB pattern for event sourcing treats each aggregate's event stream as a single document containing an array of events. This approach leverages MongoDB's atomic single-document operations, eliminates the need for transactions in most scenarios, and provides na

@markuseckstein
markuseckstein / axon-and-mongo.md
Created October 24, 2025 08:18
Analyze how Axon Event Sourcing Framework supports MongoDb

Building Event Sourcing with Axon Framework and Spring Boot: MongoDB Edition

Axon Framework 4.12.1 works with Spring Boot 3.x, but MongoDB is no longer recommended for event storage. While technical implementation is possible, production systems should avoid MongoDB as an event store due to performance degradation at scale, event ordering issues, and tracking token problems. This guide covers complete setup with critical warnings, version compatibility, and production-ready alternatives.

Spring Boot 4 compatibility remains unavailable

Spring Boot 4 is scheduled for General Availability in November 2025. Axon Framework does not yet support Spring Boot 4. The latest stable version, Axon Framework 4.12.1, supports Spring Boot 3.x (requiring Java 17+). Axon Framework 5.0 is in preview but not production-ready. For production systems today, use Spring Boot 3.5.3 with Axon Framework 4.12.1—this is the officially supported, stable combination.

The migration from Spring Boot 2.x to 3.x required A

Spring Modulith: Der komplette Leitfaden für modulare Kommunikation

Spring Modulith revolutioniert modulare Monolithen durch event-basierte Kommunikation mit transaktionaler Sicherheit. Das Framework bietet eine ausgereifte Event Publication Registry, die das Transactional Outbox Pattern implementiert und so zuverlässige asynchrone Kommunikation zwischen Modulen ermöglicht. Die zentrale Annotation @ApplicationModuleListener kombiniert @Async, @Transactional(REQUIRES_NEW) und @TransactionalEventListener zu einem Best-Practice-Ansatz für lose gekoppelte Module.

Spring Modulith ermöglicht Domain-Driven Design in Spring Boot Anwendungen durch strikte Modulgrenzen und automatische Architekturverifizierung. Module kommunizieren primär über Events für asynchrone Operationen und über definierte API-Interfaces für synchrone Request-Response-Szenarien. Die Event Publication Registry garantiert dabei, dass kein Event verloren geht - selbst bei Listener-Fehlern bleiben Events zur späteren Verarbeitung ges