23

Native-Complied Java Microservices

In this chapter, we will learn how to compile the Java source code in our microservices into binary executable files, known as Native Images. A Native Image starts up significantly faster compared to using a Java VM and is also expected to consume less memory. We will be introduced to the Spring AOT engine introduced in Spring Framework 6 and the GraalVM project and its Native Image compiler, learning how to use them.

We will cover the following topics:

  • When to natively compile Java source code
  • Introducing the GraalVM project and Spring’s AOT engine
  • Handling problems with native compilation
  • Testing and compiling Native Images
  • Testing with Docker Compose
  • Testing with Kubernetes

Even though Spring Framework ...

Get Microservices with Spring Boot 3 and Spring Cloud - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.