Skip to main content

Spring Boot

Spring Boot — convention-over-configuration framework for building Spring-based Java applications

MapStruct with Spring Boot 4 and Java Records: DTO Mapping Done Right

A beginner-first walk through MapStruct on Spring Boot 4.1.2 with Java records as DTOs: how the generated mapper works, nested and collection mapping, null-value strategies, updating existing objects, and what @AfterMapping, @BeforeMapping and @ObjectFactory really do when the target is an immutable record. Every figure comes out of a companion project whose 19 tests write the transcripts, plus the compiler's own error messages and an honestly labelled, indicative comparison with hand-written code and Dozer. Includes surprises: @MappingTarget on a record compiles to an empty method, and JDK 23+ no longer runs a processor that is only on the classpath.

Spring AI with Docker Model Runner vs Ollama: Local LLMs Benchmarked on the Same Laptop

Point one Spring AI 2.0.2 OpenAiChatModel at Docker Model Runner and at Ollama by changing only base-url and the model name. Same GGUF model, same prompts: decode speed, time to first token, container memory and tool-call success, with transcripts. Measured on a CPU-only shared sandbox with the real docker/model-runner image; GPU and Docker Desktop paths were not measured and the post says so.

Export Excel and CSV from Spring Boot: Streaming 1 Million Rows with Apache POI SXSSF

Export Excel from Spring Boot without running out of memory: XSSF vs SXSSF measured under a fixed heap (XSSF dies between 50,000 and 100,000 rows in 512 MB), 1,000,000 rows streamed with StreamingResponseBody under 64 MB, sheet rolling at 1,048,576 rows, temp-file cleanup, OpenCSV traps and a file LibreOffice will not open.

Spring AI + Spring Batch: Classifying 100,000 Support Tickets with an LLM (Throttling, Retries, Cost)

A Spring Batch 6 chunk step calls a Spring AI ChatClient for 100,000 generated support tickets. Resilience4j rate limiting and retry, skip-and-record for malformed JSON, a restart after kill -9 in a second JVM that ends byte-identical, and a per-chunk cost ledger, all run against a deterministic simulated model with every number taken from a committed transcript.