Welcome to the Engineering With Java newsletter, where we cover the best Java and Spring Boot content every week. Spend 5 minutes to get the gist of what’s happening in the Java and Spring Boot world!
Java 20’s Vector API in Production: Performance Gains Explained
Java 20’s Vector API enables hardware-accelerated SIMD operations, delivering up to 4× speedups in data-parallel tasks. It uses classes like VectorSpecies
to let developers write explicit vectorized code across platforms.
Ideal for performance-critical workloads, it gracefully degrades when vector support isn’t available.
Java, What’s Old? Part II: Utils
Explores lesser-known but highly useful Java utility classes such as Objects
, Locale
, Collator
, and Normalizer
. Though they’ve been part of the JDK for years, these tools remain essential for writing clean, null-safe, and internationalization-aware code. It’s a reminder that older features often hold timeless value, even as the Java platform evolves
Robust AI Applications with LangChain4j Guardrails and Spring Boot
Shows how to build reliable Java AI apps using LangChain4j and Spring Boot with input/output guardrails to control and secure LLM behavior. It covers prompt sanitization, output validation, and practical setup for safer AI responses.
A New Model for Java Object Initialization
Discusses problems in Java’s initialization model, focusing on variables, classes, and instances in a "larval" (partially initialized) state. These can lead to subtle bugs like premature reads of default values. Project Valhalla aims to improve this with runtime diagnostics and stronger guarantees for safer and more predictable initialization.
How to Avoid Busy-Waiting in Java
Busy-waiting in Java wastes CPU by continuously checking a condition in a loop. To avoid this, use alternatives like wait()
/notify()
, Lock
and Condition
from java.util.concurrent.locks
, or higher-level concurrency utilities like CountDownLatch
and Semaphore
which efficiently block and wake threads only when needed.
Semantic Caching with Spring AI & Redis
Semantic caching with Spring AI and Redis stores vector embeddings of queries and responses instead of exact text, allowing retrieval of similar queries rather than just identical ones. This approach reduces costly LLM calls, improving response speed and lowering operational costs.
Reactive Spring Data with R2DBC vs Blocking JPA: Throughput, Latency, and Developer Experience
Reactive Spring Data with R2DBC offers non-blocking, asynchronous DB access, handling higher throughput and lower latency (~4,000 rps) than blocking JPA (~1,200 rps). However, R2DBC’s ecosystem is less mature, requiring more manual management of relationships and transactions.
HTTP/3 in Java - Inside Java Newscast #96
JEP 517, which proposes adding HTTP/3 support to Java’s HTTP client API, was introduced in Java 11. HTTP/3, based on the QUIC protocol over UDP, offers faster and more reliable communication and is already widely adopted. The API change is minimal—adding HTTP_3
to HttpClient.Version
—but involves complex connection handling under the hood. While HTTP/3 won’t be the default yet, the groundwork is being laid for future adoption.
Deprecations and Removals - Inside Java Podcast 39
This podcast covers the phasing out of 32-bit ports, long-outdated applets, finalization (a problematic cleanup mechanism tied to garbage collection), and the legacy Security Manager. These removals, while technically complex and resource-intensive, reflect Java's ongoing efforts to simplify the platform, reduce maintenance burden, and move toward a more modern, secure, and efficient runtime.