Skip to main content

CQRS in Spring Boot Without a Framework: Separate Read Models and Projections

A real CQRS split built with no framework at all: a JPA write model, a second H2 database reached only through its own JdbcTemplate, and two interchangeable projection listeners (synchronous and @Async) that make the latency-versus-freshness trade-off measurable instead of theoretical, including a genuine 404 for an order that was just placed successfully.

Hexagonal Architecture (Ports and Adapters) in Spring Boot 4

A 4-module Maven reactor that proves "the core has no Spring dependency" with mvn dependency:tree instead of a promise, tests the business rule with zero Spring context, and hits (then fixes) three real Spring Boot 4 surprises along the way: @DataJpaTest and @WebMvcTest moved to new artifacts and packages, TestRestTemplate stopped auto-configuring itself, and Spring Data JPA's repository scan silently ignores scanBasePackages in a multi-module layout.

Modular Monolith vs Microservices in 2026: A Java Decision Framework

Most monolith-vs-microservices articles produce a tidy threshold number that doesn't survive checking the source it's attributed to. This one uses the real, enforced module boundaries from the Spring Modulith companion app to work through an honest cost accounting, what team size actually predicts, and a concrete five-step extraction sequence — ending in a decision procedure instead of a number.

Spring Modulith 2.1: Enforcing Module Boundaries Inside a Spring Boot Monolith

A clean package diagram is a promise, not an enforcement mechanism. This post builds a real 4-module Spring Boot order-fulfillment app, breaks the boundary between two modules on purpose, watches ApplicationModules.verify() fail with a real stack trace, and shows why the fix most people reach for first — routing through the public API instead of the internals — still fails, and why that matters more than the original mistake.

Debugging OutOfMemoryError: Heap Dumps, Eclipse MAT, and the Five Leak Patterns in Spring Apps

Five real Spring Boot apps, each driven to a genuine OutOfMemoryError under a constrained heap, each with a real .hprof dump read through Eclipse Memory Analyzer's headless batch report generator. Static caches, ThreadLocal, unremoved listeners, classloader leaks, and unbounded queues -- with the real console transcripts and MAT leak-suspect evidence for every one, plus what the JVM's own defaults quietly leave out when the crash happens in a container.

JVM Flags for Spring Boot in Containers (JDK 25/27): The Production Cheat Sheet

A flag-by-flag reference for running Spring Boot in containers on JDK 25 and JDK 27, measured in real Docker containers: how UseContainerSupport derives CPU count, collector and heap size from the cgroup, why MaxRAMPercentage fails safely while a hardcoded -Xmx gets the container SIGKILLed, the ActiveProcessorCount lie that inflates GC threads, native memory the heap percentage doesn't cover, and what JEP 523 and JEP 534 change by default on JDK 27.

Java Flight Recorder and Mission Control: Profiling a Live Spring Boot App in 20 Minutes

A hands-on guide to profiling a live Spring Boot app with Java Flight Recorder: real jcmd and jfr sessions finding a CPU hot method, allocation pressure and lock contention, a custom business event, and four traps that corrupt or hide data — a threshold that silently discards 12ms waits, a shared threshold between concurrent recordings, events lost to a missing try/finally, and a dump/stop bug that doubles every event.

Immutable Collections in Java: List.of vs unmodifiableList vs copyOf

Collections.unmodifiableList, List.of and List.copyOf all refuse direct mutation, but only two of them reject null elements and only one of them is a real snapshot rather than a live view over a list you still hold a mutable reference to. Covers null handling, views vs copies, real JMH construction/read overhead, a brief Guava ImmutableList comparison, and the record field that looks immutable but isn't.