DEV Community

Karsten Silz
Karsten Silz

Posted on • Originally published at bpfnl.substack.com

How to Build Java Applications Today: August 16, 2021

TL;DR

Will Project Loom kill reactive programming, more VS Code Java improvements, JDK Mission Control 8.1.0, Spring Data 2021.0.4 & 2020.0.12, Quarkus 2.1.2, Micronaut 2.5.12.


README

This is issue #49 of my weekly newsletter, “How To Build Java Applications Today”. I read all the Java newsletters, so you don’t have to! And it’s “Java news with a smile”.

If you like my newsletter, then subscribe to it on Substack! Or read it on dev.to, the Java Cafe, or Medium. Even better: Share it with people who may be interested.


Quote of the Week

Venture backed companies fail when they run out of money. Bootstrappers fail when they run out of motivation.
Rob Walling, a serial entrepreneur, has a point - but bootstrappers need money, too.


Stand-Up

It’s still August, it’s still vacation time, and there’s still not much happening in Java land. So I hope my readers enjoy the sun and their vacation! And that’s almost an excuse for not reading newsletters like this, “almost” being the important word here! 😉


Code Review

Issue 48 from August 9, 2021

I wrote last week that Java climbed to #2 in the RedMonk Ranking. That is true. I also noted that Java is ahead of Python. That is false: Java and Python share the #2 spot.


ADVERTISEMENT

22 YEARS OF FULL-STACK JAVA FOR HIRE NEXT JANUARY

I’m a full-stack Java developer with 22 years of experience, looking for a project in January 2022, in Milton Keynes, London, or remote. I’ll work as a contractor or fixed-term employee but don’t take permanent positions.

Interested? Then check out my resume & work samples!

CHECK OUT MY RESUME & WORK SAMPLES


Bookmarks

Java

Will Project Loom Kill Reactive Programming?

Oracle’s Project Loom reinvents threads in Java. That’s why it competes with reactive programming in Java. Project lead Ron Pressler claimed last year, as a fact, that “not many people like” reactive programming. Earlier this year, he was more mellowed, saying that Project Loom exists because debugging a reactive program is so much harder (see issue #39, section “Why Do We Need Project Loom?”).

Well, now we’re back to fighting words: Brian Goetz, the architect for the Java language at Oracle, says that “Project Loom will kill reactive programming”. Like Ron before, Brian argues that reactive programming scales nicely but is too difficult to program. And once Java threads and their simple usage scale nicely, too, we don’t need reactive programming anymore.

Here’s the part I don’t understand: With reactive streams, a consumer receives multiple values over time from a producer. And the consumer can tell the producer to slow down (“backpressure”). These seem like useful abstractions. Do they disappear with Project Loom? Or will they be a library on top of Project Loom?

Meanwhile, Ron Pressler gave an insight into why Project Loom “just” reimplemented Java threads: Java threads have the advantage over “async/await” that the runtime can switch between threads everywhere in the code except for a critical section (“synchronized”). And Oracle can do Project Loom because they can change the internal JVM representation of a thread. Finally, he described “structured concurrency” as a future Loom feature:

try (var execute =
  Executors.newVirtualThreadExecutor(factory)
           .withDeadline(Instant.now().plusSeconds(30))) {
    executor.submit(task1);
    executor.submit(task2);
}
Enter fullscreen mode Exit fullscreen mode

So here we’re submitting two tasks in parallel, wait for both of them to finish, and cancel if we’re not finished within 30 seconds. Today, this requires additional libraries.

So, when can we try Project Loom? “Soon” is what both said. So that means a preview in Java 18 next March at the earliest, possibly only Java 19 in September 2022. Then it will take probably at least two releases to get finalized. My guess is 2023 for Project Loom in production. Now, most organizations only use the Java LTS releases, so they’ll get their hands on Project Loom in September 2024 with Java 23.

Brian Goetz interview, Ron Pressler presentation


Tools

More VS Code Java Improvements

Last month I wrote an InfoQ article about how Microsoft’s Visual Studio Code (VS Code) boosted its Java IDE capabilities. Well, Microsoft didn’t stop there: The July release of VS Code makes it easier to run, view and search tests in Java. And from the department of “Duh!”: Microsoft “realized that Maven dependency conflict can be tricky to handle”, so they improved the display of Maven conflict resolution.

But there’s more: The roadmap for the rest of the year includes a better edit/compile/debug cycle, support for Gradle, more Java versions and Spring for Remote Development(using a container or remote machine as a development environment), and support for Project Loom (see above).

So it seems VS Code could be a serious competitor for Eclipse and Netbeans early next year. I recently switched from JetBrains WebStorm to VS Code for website development and like VS Code. It certainly feels snappier than WebStorm to me. And unlike JetBrains IDEs, it can update most plugins without a complete restart - yay!

Another benefit of VS Code for us Java developers could be convenient support for other languages: Python, Rust, Go, … - all in one IDE. It’s probably more robust than what Eclipse currently offers. And with JetBrains, we’d have to run multiple IDEs that - I think - don’t share plugins, configuration settings, or keyboard shortcuts by default.

July update


Releases

JDK Mission Control 8.1.0

This tool visualizes Java Flight Recorder (JFR) data and therefore helps to profile Java in production (see issue #43, section “Free Java Production Profiling To Whither Away?”). It now needs Java 11+ and Eclipse 2021-03 to run and reads in JFR data about 25% faster. It also recognizes the memory allocation JFR event from Java 16 (see issue #25, section “Profiling in Production?”) and has a new view for constant values in the JFR recording.

Announcement


Spring Data 2021.0.4 & 2020.0.12

Both these libraries require (?) the upcoming Spring Boot 2.4.10 and 2.5.4 releases. It’s business as usual: Bug fixes and dependency upgrades for the 15 (version 2021.0.4) / 16 (2020.0.12) sub-projects, all listed on the announcement page.

Announcement


Quarkus 2.1.2

Quarkus marches on with another bugfix release. The changelog has 35 entries.

Announcement


Micronaut 2.5.12

Quarkus isn’t the only Spring Boot challenger in town, though it probably is the fastest-releasing one: This minor release from Micronaut has seven changes, mostly documentation updates.

Changelog


About

Karsten Silz is the author of this newsletter. He is a full-stack web & mobile developer with 22 years of Java experience, author, speaker, and marathon runner. Karsten got a Master's degree in Computer Science at the Dresden University of Technology (Germany) in 1996.

Karsten has worked in Europe and the US. He co-founded a software start-up in the US in 2004. Karsten led product development for 13 years and left after the company was sold successfully. He co-founded the UK SaaS start-up "Your Home in Good Hands" as CTO in 2020. Since 2019, Karsten also works as a contractor in the UK.

Karsten has this newsletter, a developer website, and a contractor site. He's on LinkedInTwitter, and GitHub. Karsten is also an author at InfoQ.

Top comments (0)