News

Java Annotated Monthly – December 2024

As 2024 wraps up, this December edition of Java Annotated Monthly brings you the latest on JEPs targeted for Java 24, helpful tutorials on Java, Kotlin, and AI, and more. This time, we’ve included thought-provoking non-tech articles perfect for year-end reflection. Plus, we’re thrilled to welcome Josh Long as our featured author, who will be sharing the latest Spring updates. 

Grab a cup of something warm and enjoy a mix of learning, inspiration, and fresh perspectives to close out the year!

Featured Content 

Josh Long

Josh Long became the first Spring Developer Advocate in 2010, and he has served in that role ever since. Josh is a Java Champion and the author of 7 books (including Reactive Spring) and numerous best-selling video training materials (including Building Microservices with Spring Boot Livelessons with Spring Boot co-founder Phil Webb). He is also an open-source contributor (Spring Boot, Spring Integration, Axon, Spring Cloud, Activiti, Vaadin, etc), a Youtuber (Coffee + Software with Josh Long as well as a Spring Tips series), and a podcaster (A Bootiful Podcast).

Hi, Spring fans! I want to start off with something profoundly simple: thank you! Last week, we Americans celebrated Thanksgiving, a holiday that is (when it’s at its best) about being thankful. I am thankful for you all. You know what else I am thankful for? That the Spring Boot team got Spring Boot out the door a week earlier this year, so I can enjoy my turkey in peace! Yes, Spring Boot is officially out, and it’s jam-packed… stuffed like a Thanksgiving turkey!

I was told these Java Annotated Monthly installments need to be pithy, concise. (Do they know me?) But I wanted to talk about all the goodness in Spring Boot 3.4. I am not sure how I am meant to keep the discussion of six months of amazing new software to the lengths required for this installment. Then it dawned on me! Links are short. Read this; it’s my much longer-form thoughts on just some of the amazing new features when you’re using Spring Boot 3.4!

Still here? Just want the TL;DR? Did I hear you say “listacle”? Fine! Here are my top thirty-four (34 for Spring Boot 3.4) favorite features shipping with Spring Boot 3.4, grouped by the technologies to which they belong. We’ll start at the top of the abstraction stacks, those technologies that build upon Spring Boot first:

Spring Modulith has…

  • Support for nested application modules and external application module contributions.
  • New deleting and archiving event publication completion modes.
  • By-ID event publication completion significantly improves performance.
  • Event externalization into Spring’s MessageChannel abstraction to, for example, trigger Spring Integration flows.

Spring AI has…

  • A ton of work done around function calling, both in Java and Kotlin.
  • And the first cut of support for the ideas taking shape in the AI community around “advanced and modular RAG”. 

Then move on to Spring Boot itself:

Spring Boot has…

  • An updated auto-configuration experience for underlying HttpRequestFactory implementations that are plugged into either the RestClient or RestTemplate.
  • Newly added support for structured logging, with built-in support for Elastic Common Schema (ecs), Graylog Extended Log Format (gelf), and Logstash (logstash).
  • An updated auto-configuration for ActiveMQ Classic support for an embedded broker.
  • The paketobuildpacks/builder-jammy-java-tiny set for use by default. This builder supports ARM and x64 platforms out of the box. Yes, you read that right: you can build Docker images with your GraalVM native images on Apple Silicon, and it’ll work! 
  • Improved Spring Boot Actuator endpoints that show more information about SSL bundles and scheduled tasks.

And then the things upon which Spring Boot depends:

Spring Framework has…

  • Support for the concept of @Fallback beans, essentially the mirror image of @Primary beans.
  • Fragment rendering! This one is for you HTMX and Turbo enjoyers! You can now render multiple views in one request or create a stream of rendered views.
  • Easier reflection of non-Spring-managed beans with @Reflective and the new @ReflectiveScan annotation.

Spring Data has…

  • A new Repository fragments SPI that lets any arbitrary .jar on the classpath contribute extensions to the Spring Data repository.
  • Much-reduced query parsing overhead in Spring Data JPA.
  • Expiration for @TimeSeries in Spring Data MongoDB.
  • Keyspace qualification for tables and user-defined types in Spring Data for Apache Cassandra.
  • Jedis Lua scripting support in transaction and pipeline operations in Spring Data Redis.

Spring Batch has…

  • Gone from one to three – count ’em: three! – JobRepository implementations.
  • New support for data classes – Kotlin data class or Java record instances – when using a JDBC-based ItemReader<T>.
  • Concurrent steps with BlockingQueueItemReader<T> and BlockingQueueItemWriter<T>; this is the EZ button for staged event-driven architectures (SEDA)!
  • A CompositeItemReader<T> that can sequentially drain data from more than one delegated ItemReader<T>.

Spring Integration has…

  • Big improvements to remote file system inbound adapters.
  • A convenient Consumer<SshClient> to allow for further customization of the internal SshClient.
  • Scripting support for Python that now builds on the GraalVM Truffle Polyglot project.
  • A new BaseMessageBuilder that has been extracted from the MessageBuilder to simplify building your custom builder implementation, where most of the logic should be identical to that of MessageBuilder.
  • Easier configuration for the control bus pattern, along with a new control bus HTTP controller.

Spring Security has…

  • Introduced support for WebAuthN/Passkeys! Yes, that’s right, you can have people logging into your application with their laptop’s fingerprint reader, their Yubikey, their phone’s face scanner, and more, in no time!
  • “Magic links” – insta-login a person with a link!
  • OIDC back-channel support that now accepts logout tokens of type logout+jwt.
  • The Spring RestClient that can now be configured with OAuth2ClientHttpRequestInterceptor to make protected resource requests.
  • A token exchange that now supports refresh tokens.
  • A token exchange that now supports refresh tokens. Technically, the Spring Authorization Server isn’t part of Spring Security, but I’ll mention it here for simplicity. It includes many new features, including a markedly more consistent and concise DSL configuration. Getting a whole OAuth IDP up and running with one line of Java code in a typical Spring Security application and a few configuration lines in your properties or YAML file is SO NICE.

As always, if you want to try things out, you just need to go and choose File | New Project | and choosing Spring Boot from among the project types in the fantastic IntelliJ IDEA IDE. If you’d like to learn more, maybe check out the Spring Guides, Spring Academy, or my YouTube channel!

Thank you.

Java News

Java News Roundup 1, 2, 3, 4 – Don’t miss any Java news from the past month. 

Here is the list of JEPs targeting JDK 24:

Java Tutorials and Tips

Exploring New Features in JDK 23: Module Design Pattern with JEP-476 – In this article, Miro Wengner focuses on the innovative module design pattern and explains how this update enhances modularity and scalability in Java development.

Why Java 8 is a Ticking Time Bomb Hiding Within Your OrganizationFrank Delporte discusses the risks associated with continuing to use Java 8, including security vulnerabilities, performance limitations, and reduced developer productivity, advocating for upgrading to newer Java versions to mitigate these issues.

Discovering the perfect Java Supply Chain Attack vector and how it got fixed – This article walks you through the fascinating process of uncovering a critical vulnerability in the Java ecosystem and teaches you about the measures taken to resolve it. It highlights the importance of securing supply chains and shares insights to help developers safeguard their projects.

Migrating from the Javax to Jakarta Namespace in Spring Boot App – In this article, Mónika Lombos provides a practical guide to migrating Spring Boot applications from the javax namespace to the jakarta namespace. She explains the steps, challenges, and considerations involved in making this transition smooth and efficient.

Leverage LLMs in Java with LangChain4j and Quarkus – Holly Cummins and Georgios Andrianakis explore how combining LangChain4j and Quarkus can simplify building applications powered by LLMs. 

Pattern Matching in Java – Past, Present, FutureAggelos Biboudis talks about the evolution of switch and instanceof in Java, from their classic roles in data introspection to their modern transformation into powerful tools for pattern matching.

Postcards from the Peak of Complexity – In this talk, Brian Goetz shares insights, lessons, and behind-the-scenes stories from the development of Java’s major features, such as generics, lambdas, and virtual threads.

Mark–Scavenge: Waiting for Trash to Take Itself Out – This blog post summarizes the new Mark-Scavenge garbage collection algorithm, which tackles the inefficiencies of using reachability as a proxy for liveness in moving GCs, leading to reduced unnecessary data movement. The work is part of a research collaboration between Oracle and Uppsala University, with the full paper available on the ACM website.

Java-Based No-Code and Low-Code Application Bootstrapping Tools Review – What exactly are no-code or low-code platforms? This article will help you understand them, while also explaining how to avoid common mistakes and pitfalls. 

Java Language Futures – Fall 2024 EditionGavin Bierman explores the future of Java, summarizing recent changes while providing insights into upcoming directions and features currently in development. It’s an excellent overview for those keen to see what’s next for the language.

What collection mapping should I use?Gavin King explains how to map collections and @ManyToMany associations in Jakarta Persistence, providing tips on choosing the right collection types and annotations for better code.

Some Common Java GotchasPeter Lawrey explores frequent pitfalls developers encounter when working with Java, offering insights and practical advice for navigating these challenges effectively. 

Ten Java Myths and Misconceptions – Another interesting piece by Peter Lawrey where he demystifies common misunderstandings about Java.

Optimizing Java Applications on Kubernetes: Beyond the Basics – In this talk from the InfoQ Dev Summit Boston conference, Bruno Borges discusses strategies for enhancing Java application performance on Kubernetes, focusing on leveraging JVM ergonomics, and managing garbage collection processes.

Build and Run TornadoVM with IntelliJ IDEA – TornadoVM is an open-source Java technology designed to help developers optimize their codebases for hardware acceleration. This blog post provides a detailed guide on building TornadoVM with IntelliJ IDEA and running TornadoVM unit tests or other Java programs.

Hashcode and Equals Debugging, PerformanceShai Almog examines the inefficiencies in Java’s hashCode() and equals() methods and offers insights for avoiding such pitfalls.

Kotlin Corner

Kotlin K2 Mode Becomes Stable – Learn more about IntelliJ IDEA’s Kotlin K2 mode, which is now out of Beta and ready for general use starting from version 2024.3. K2 mode significantly improves Kotlin code analysis stability, memory consumption efficiency, and the IDE’s overall performance – and it supports Kotlin 2.1 language features, too.

The best dispatcher for a backend framework Marcin Moskała examines various Kotlin coroutine dispatchers to identify the most suitable one for backend request handlers, providing insights into their performance and appropriate use cases.

Kotlin Tips and Tricks You May Not Know: #3 — Built-in Assertions – This is a light yet insightful read that shows you how to write cleaner, safer Kotlin code with powerful built-in tools you might not be using yet!

Kotest + Spring + Testcontainers Ronny Bräunlich demonstrates how to easily integrate Kotest, Spring, and Testcontainers for a smoother Java testing setup.

Anonymous Functions Aren’t Lambdas – In his video, Dave Leeds introduces Kotlin’s anonymous functions, those rare gems that combine the best of named functions and lambdas, and shows you how to spot and use them effectively in your code.

Fun with Function Types in Kotlin – In another video, Dave takes you on a tour of Kotlin’s function types, from regular and extension functions to bound and property references.

Understanding GradleDuncan McGregor takes a deep dive into Gradle builds, exploring task dependencies, build artifacts, and optimization tricks like skipping unchanged tests. 

Advanced Kotlin Coroutine Cheat sheet (for Android Engineer) – This practical guide by Gaëlle Minisini untangles the complexities of Kotlin coroutines, offering Android developers handy tips and best practices to level up their async programming skills.

State of Kotlin Scripting 2024 – Find out more the evolution of scripting in Kotlin, along with tips to supercharge your scripting workflows.

Languages, Frameworks, Libraries, and Technologies

This Week in Spring 1, 2, 3, 4 – Check out all the important Spring news.

Spring Boot: Java Template Engine (JTE) – Learn more about the Java Template Engine (JTE) – a new addition to the Spring Initializer ecosystem.

The Latest in the World of Web Engineering (Featuring AI) – In this talk from Qcon London, Tejas Kumar overviews web engineering in relation to AI, intelligent answer engines, an update on CSS, HTML, JavaScript, and personal health and productivity.

Front End Debugging Part 1: Not just Console LogShai Almog highlights advanced debugging techniques, such as the use of the debugger keyword, triggering debugging from the console, and setting DOM and XHR breakpoints.

Podcast: Generally AI – Season 2 – Episode 6: the Godfathers of Programming and AI – The hosts discuss Geoffrey Hinton, the “Godfather of AI”, who developed key algorithms like backpropagation, helped with neural visualization using t-SNE, and sparked renewed interest in neural networks with the success of AlexNet. Less than a month after this podcast was recorded, Geoffrey Hinton won the Nobel Prize for Physics for his research into neural networks.

The best way to determine the optimal connection pool sizeVlad Mihalcea provides a practical guide to determining the ideal connection pool size for database applications, balancing performance and resource efficiency.

Redacting sensitive information when using Generative AI modelsGuillaume Laforge delves into strategies for protecting sensitive data when using AI. 

Conferences and Events

Get ready for the last events of this year:

Culture and Community

Name things unambiguously – In this article, Peter Hilton explores the challenges of ambiguous naming in software development and how it can lead to misunderstandings and bugs. Are your names crystal clear, or do they cause chaos in your code?

The Philosophical Implications of Technology: A Conversation with Anders Indset – In this podcast, Shane Hastie, Lead Editor for Culture & Methods, chats with Anders Indset, a Norwegian philosopher exploring the impact of technology on humanity.

The Efficiency Paradox and How to Save Yourself and the WorldHolly Cummins talks about the ups and downs of trying to be efficient. This piece can be a good point to start a discussion about this topic. 

How we almost missed a plane in Kazakhstan, but OpenJDK could have saved us… – Ever thought Java could help with travel drama? Read this article to find out if it’s possible. 

What Developers Can Do to Continue to Program as They AgeBen Linders summarizes insights that Kate Gregory shared at NDC Tech Town, including practical tips for adapting work environments and maintaining the personal well-being of older workers. 

Podcast: Trends in Engineering Leadership: Observability, Agile Backlash, and Building Autonomous Teams – Learn more about the trends in software engineering, including the pushback against “Agile” practices, the rise of observability, people-focused metrics, ways to align teams while keeping their independence, and more. 

Day 13 of BlueSky; thoughts so far – Are you giving BlueSky a chance?

Foojay Podcast #61: As a developer, how do we keep our body and mind healthy? – This podcast episode explores how developers can maintain physical and mental well-being, featuring insights from industry professionals on topics like AI’s impact, the challenges of remote work, and preventing burnout.

5 Lessons I learned the hard way from 10+ years as a software engineer – What lessons have you learned?

Being a Responsible Developer in the Age of AI Hype – If you are curious about how developers can cut through the AI hype responsibly, check out this article. 

And Finally…

IntelliJ IDEA 2024.3 Is Out! – IntelliJ IDEA 2024.3, the final major release of the year, is packed with new features and enhancements to elevate your development experience. Highlights include a visual representation of your code’s logical structure in the Structure tool window, improved debugging for Kubernetes applications, and cluster-wide Kubernetes log access.

Faster Time-to-Code in IntelliJ IDEA – In this post, you can read about the key steps we’ve taken to enhance performance in the latest versions of IntelliJ IDEA. These improvements focus on reducing time-to-code through phased indexing and making the IDE more responsive, ensuring a faster and smoother experience from the moment you start up.

Top Java Blogs for Experienced Programmers – Check out our curated selections of the best expert blogs on Java. 

In Memory of Stiver – Sad news for the Java community: Stiver, the original author of the Fernflower Java decompiler, has passed away.

How to Use Flyway for Database Migrations in Spring Boot Applications – In this article, you’ll discover why Flyway is a must-have for database migrations, how it works, ways to integrate it with Spring Boot, and how IntelliJ IDEA Ultimate simplifies migration script generation.

From Code to Clarity With the Redesigned Structure Tool Window – This article shows how AI-inspired updates to the Structure tool window make exploring code and performing actions easier with the new Logical view.

Advanced Code Analysis in IntelliJ IDEA – Level up your code analysis with Marit van Dijk. Learn how to find specific patterns in your code and create custom inspections in IntelliJ IDEA.

Declarative Gradle in IntelliJ IDEA – Find out what Declarative Gradle is and how to try it. 

Livestreams

The JUnit Crew Presents What’s New – In this session, the JUnit team introduces the new features of the recent 5.11 release, along with highlights from the previous 5.9 and 5.10 releases.

That’s it for today! We’re collecting ideas for the next Java Annotated Monthly – send your suggestions via email or X by December 20. Don’t forget to check out our archive of past JAM issues for any articles you may have missed!

image description