Skip to main content

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.

LRU Cache in Java: LinkedHashMap, HashMap + Doubly Linked List and a Thread-Safe Version

Three ways to build an LRU cache in Java: LinkedHashMap with accessOrder, HashMap plus a hand-rolled doubly linked list with sentinels, and thread-safe variants (synchronized, ReentrantLock, striping). Includes an O(1) dry-run table, a demo of why ReadWriteLock corrupts the list, a stress test with real assertions, an indicative JMH comparison and Caffeine as the production answer.

Instancio: Generate Realistic Test Data Automatically in Java

Instancio 6.1 fills whole Java object graphs with random data and replays any failure from a seed. Run on JUnit 6.1.3: selectors, Settings, records and sealed types, TypeToken, the extension, and the real seed message from a failing test.

Reactive Data Access with Spring Data R2DBC: CRUD, Transactions and When to Choose It

A hands-on Spring Data R2DBC guide on Spring Boot 4.1 and JDK 25: ReactiveCrudRepository, custom queries, DatabaseClient, reactive transactions that roll back, Testcontainers Postgres with StepVerifier, an honest look at having no relations, and when virtual threads with JPA are the better default. Every transcript comes from a real run.

The Java ClassFile API (JEP 484): Read, Generate and Transform Bytecode Without ASM

java.lang.classfile has been final since JDK 24 (JEP 484). Parse a class, generate one at runtime and load it as a normal or hidden class, and insert timing around every method with ClassTransform, MethodTransform and CodeTransform, all run on JDK 25. The same three jobs are repeated in ASM 9.11.1 and compared, including the traps in both, the class-file versions each reads, a JDK 24/25/26 API diff and what spring-core 7.0.10 actually ships.

Image Generation and Vision in Spring AI: ImageModel, Prompt Options and Safe Storage

How to generate images with Spring AI's ImageModel and keep them safely: what the real OpenAiImageModel sends (including an options object that silently resets the model), a moderation gate and what Spring AI does not moderate, verified storage in MinIO/S3 with sniffed content types, size and pixel caps and server-chosen keys, and a per-provider cost table dated 2026-10-28. No image provider was called; the model and moderation are scripted fakes and the bucket is a real MinIO.

Soft Delete in Hibernate 7: @SoftDelete vs @SQLDelete + @SQLRestriction

Hibernate 7's native @SoftDelete (DELETED, ACTIVE and TIMESTAMP strategies) compared with the hand-rolled @SQLDelete + @SQLRestriction recipe, run against PostgreSQL 17 and H2: the generated SQL, restoring rows, the unique-index traps (partial indexes, NULLS NOT DISTINCT), associations and join tables, native queries that bypass the filter, and what Spring Data JPA does with it.

Spring Boot 4 + Thymeleaf + htmx: Server-Side CRUD UI in 2026

Build a contacts screen with Spring Boot 4.1.2, Thymeleaf 3.1.5 and htmx 2.0.11 and no JS framework: one URL that returns a full page or a fragment, 422 validation re-render, pagination, inline edit and delete, with MockMvc tests and a headless Chromium check, and the htmx 2 status-code traps that bit during the build.