Weekly Links: January 4, 2021
Project Loom wants to reinvent threads in Java. The Loom project leader even argues that most people don’t like the reactive programming model withs streams and are better served with Loom’s virtual threads. One of the Jetty authors investigates: Do Loom’s claims stack up?
No, they don’t. Yes, we can run a million Loom threads on our laptops — but only if they don’t have deep call stacks! Under more realistic circumstances, the author only manages to create as many Loom threads as conventional ones. And we pay the price for virtual threads: Higher memory usage and much longer garbage collections. In part 2, the author finds that thread pools hold up just fine against Loom.
Yes, writing blocking code is easier with Loom. But it’s not the game-changer (now) that Oracle promised. There’s still time for Loom to improve, given that it won’t launch before 2022 at the earliest.
This long-running Java podcast is now also on YouTube. And in this episode, it looks at Java heap dumps. We need heap dumps to find memory leaks in Java. So here you learn how to create and analyze such heap dumps. There’s an audio version as well. Go here to play it directly in your browser.
Most of the best practices here apply to Spring Boot in general: Collect metrics, don’t forget about logging, and don’t be afraid of using circuit breakers. I especially liked how you can enable an
/info endpoint that shows Git commit & build information.
A resilient application withstands errors and faults. It achieves this with time limiters, bulkheads, circuit breakers, rate limiters, retries, and caches. Resilience4J provides these patterns in Java. Although we can use Resilience4J in any Java application, the article demonstrates it with Spring Boot. And you can see why: Decorating a method call with
@Retry(name = "retryConfig", fallbackMethod = "fallback") is powerful, indeed!
MicroProfile is “Spring Boot with Java/Jakarta EE pars”. Two months ago, I wrote about why Eclipse MicroProfile missed its June 2020 release date: They had to follow Eclipse rules. So now they have a specification process, and a working group, and a steering committee. Yay! Best of all: They did manage to release 4.0 on December 23, 2020. Most APIs have changed. This article gives an overview of the changes in Config 2.0, Fault Tolerance 3.0, Health 3.0, and Metrics 3.0. And yes, another article without ids on the section headings…
on how to build Java applications today.