How to Build Java Applications Today: June 7, 2021
What’s new in Java 17, why Project Loom, Alibaba forks PostgreSQL, Prosus buys Stack Overflow, Hibernate 5.5.0, Spring Cloud 2020.0.3, Spring Integration AWS 2.5.1, Helidon 2.3.0, Eclipse Vert.x 4.1.0
This is issue 39 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”!
Quote of the Week
If you need a machine and don’t buy it, then you will ultimately find that you have paid for it and don’t have it.
This was torture: While I was writing this, Apple’s WWDC keynote happened. And I’m an avid Apple user: Mac, iPhone, iPad, Watch, Apple TV, even two big HomePods - the whole shebang. To add insult to injury, my Mac’s leasing ends this August, so I did hope for a new MacBook Pro 16”. Alas, no such luck. 😒 First world problems!
In other news, I booked another conference appearance. This time, I’m not talking about front-ends but about picking technologies faster with JHipster. It’s on June 16 - but in German. If this is your cup of tea (or glass of beer), you can buy a ticket here.
What’s New in Java 17?
Due on September 14, Java 17 will be the next Long-Term Support (LTS) release. We’re just a few days away from the planned feature freeze on June 10. So what made the cut for Java 17?
It’s just bits ’n pieces unless you’ve got a Mac with Apple’s M1 chip - Java 17 will run natively there. Project Loom will be completely missing, and Project Valhalla won’t be complete in Java 17, either.
But what do we get?
The (few?) among us who still use Java serialization get filters to make it more secure. The (even fewer) authors of “numerically sensitive libraries” can breathe easier with the restoration of always-strict floating point semantics. Random number generators get better, and sealed classes leave the incubator status behind (they were introduced in Java 15). And the small Venn diagram of “Java desktop program users” and “macOS users” gets a new rendering pipeline that uses Apple’s Metal framework.
Some incubating features see updates but aren’t final yet. That includes the pattern matching for
switch, the foreign function and memory API for interaction with the world outside Java, and the vector API that supports very fast “compute engines” in modern CPUs.
Oracle removes a lot in this release, too: The Security Manager, for instance, there since Java 1.0, will be deprecated. We can’t get to some JDK internal classes through the
-illegal-accessJVM parameter anymore. Few among us will probably miss the “experimental AOT and JIT compiler” or the Applet API (see section “The End of Applets” in issue 28).
Why Do We Need Project Loom?
Oracle’s Project Loom reinvents threads in Java. The last time that project lead Ron Pressler took to the mic, he claimed that most people who use the reactive programming model don’t actually like it. And nope, he provided no evidence for this “fact”. Then a Jetty author found that at least performance-wise, thread pools hold up just fine against Loom under realistic circumstances. See here for the whole saga.
Now Ron’s at the mic again. What news does he share with us?
He stays away from claiming to know the likes and dislikes of millions of developers this time around. Smart choice! So now he’s saying that Project Loom exists because debugging a reactive program is so much harder: “If you have an exception, the troubleshooting context you get is the thread stack. And once you use those reactive frameworks, the thread stack you get doesn’t really have any valuable information, any useful information, in it because the same task really moves from one thread to another.”
So, how’s the debugging experience with Loom?
Project Loom worked with “IDE vendors […] to make sure that we have the right user experience. […] So with Loom, you will at least be able to step through code”. In other words: Debugging with Loom didn’t work out of the box.
Let me get this straight: Project Loom exists because debugging reactive programs is too hard. And then debugging with Loom didn’t work either!
Hm… Is it just me, or could Oracle have skipped the whole “reinventing Java threads” part and instead worked with IDE vendors to make reactive debugging easier? After all, at least Spring Reactive made debugging nicer already.
InfoQ podcast (Audio & transcript)
Frameworks & Libraries
Alibaba Forks PostgreSQL
PostgreSQL is the self-proclaimed “most advanced open-source relational database”. Well, not advanced enough for Alibaba, the Chinese company that is the world’s biggest e-commerce platform by some measure. Just think of a “combination of Amazon, eBay and PayPal”. They forked PostgreSQL and call it “PolarDB for PostgreSQL”. PolarDB is available on GitHub under the Apache 2.0 license.
Why did they do that? PostgreSQL can already be enhanced quite nicely with extensions.
First of all, PolarDB for PostgreSQL is a “share-nothing distributed database, which supports global data consistency and ACID across database nodes, distributed SQL processing, and data redundancy and high availability through Paxos based replication.”
Next, Alibaba did use a PostgreSQL extension. In fact, that’s where the majority of their changes reside. The PostgreSQL patch only adds features that aren’t possible in an extension, such as “distributed MVCC for different isolation levels”. MVCC is “Multiversion Concurrency Control” and what PostgreSQL already uses - just not in a distributed way. Because the patch is relatively small, Alibaba expects that “PolarDB can be easily upgraded with newer PostgreSQL versions and maintained full compatibility with PostgreSQL”.
So if you like PostgreSQL, but it’s not distributed or global enough for you, then PolarDB may be the right choice. Just be careful when you Google for it - there’s also “PolarDB for MySQL” and “PolarDB-O” (“compatible with the Oracle syntax”) by Alibaba.
Prosus Buys Stack Overflow
The one site on the Internet that’s responsible for roughly half of all “copy & paste” commands from developers just got sold. So yes, Stack Overflow now belongs to Prosus. And no, I didn’t know Prosus, either. Apparently, they own a stake in Codeacademy and Udemy, among other investments.
So what will change now with Stack Overflow?
According to the Stack Overflow CEO, not a lot: “Our site and our products will not change in the coming weeks or months, just as our company’s goals and strategic priorities remain the same”. But then again, that’s the guy who buried the bad news of “We laid off staff and may sunset some or all of our ‘Stack Overflow Talent’ business” in a mountain of corporate jargon.
That’s why I’m glad that Joel Spolsky took to the keyboard and confirmed that “Stack Overflow will continue to operate independently, with the exact same team in place that has been operating it, according to the exact same plan and the exact same business practices”.
I was a big fan of Joel in the early 2000s. Some of his articles still hold up nicely, like “Ben and Jerry’s vs Amazon”. Geez, I’m really getting old, talking about the good old times. What’s next? Yelling at the kids on my lawn?!
Anyway, let’s hope that Stack Overflow will continue to serve us well, and that there really is nothing to see here.
The main new feature is the support for Jakarta EE 9 with the new
jakarta.persistence namespace (see section “Jakarta EE 9.1” in the last issue). That’s in the JAR files with the
-jakartaappendix in the file name (as in
Viewing the full release notes requires a Hibernate JIRA account. It’s not worth it: There are dependency updates for JUNit and Log4j 2, three improvements, and one bug fix.
Spring Cloud 2020.0.3
Spring Integration AWS 2.5.1
Spring Integration for Amazon Web Services has a new release. For some reason, it dragged “Spring Cloud Stream Binder for AWS Kinesis 2.2.0” along for the party.
Spring Integration AWS 2.5.1 has some minor bug fixes (not listed on GitHub). Spring Cloud Stream Binder for AWS Kinesis 2.2.0 includes Spring Cloud 2020.0.3 (see previous section) and has unknown “bug fixes and improvements”.
Firstly, it integrates with Oracle Cloud’s automatic discovery. Now, Oracle’s cloud isn’t in the same league as AWS, Microsoft Azure, or Google’s cloud. But if you use it, chances are you also use some free stuff from Oracle, like Helidon. So that makes perfect sense.
Eclipse Vert.x 4.1.0
Did you know that Eclipse also has a reactive framework? I must say that for something that “most developers don’t like” (see section “Why Do We Need Project Loom?” above), there’s an awful lot of reactive frameworks out there… But what do I know?!
This version supports the Reactive Microsoft SQL Server Client, RxJava 3, Open Telemetry, and Kotlin 1.5 (see section “Kotlin 1.5” in issue 35). It introduces HTTP proxies and adds other enhancements.
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 entrepreneur. Karsten got a Master’s degree in Computer Science at the Dresden University of Technology (Germany) in 1996.
Karsten co-founded a software product start-up in the US in 2004. He 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.