×

Micronaut 3.8.0: Build Scalable Applications with the Updated CRaC Feature

MMS Founder
MMS A N M Bazlur Rahman

Article originally posted on InfoQ. Visit InfoQ

Just one week after the release of version 3.7.5, the Micronaut Foundation released Micronaut 3.8.0. This new version brings several exciting features, including support for GraalVM 22.3.0, the ability to use @RequestBean annotations with Java records, and a new command that guides users in creating a Micronaut AWS Lambda project. This release also includes updates to Micronaut Data, Micronaut Security, the Micronaut CLI, and Micronaut Launch, as well as improvements to the Micronaut Maven Plugin.

This release introduces the ability to use @RequestBean annotations with Java records. Before this release, the only way to bind values to the HttpRequest, @PathVariable, @QueryValue or @Header fields was to use a POJO as a controller method parameter and mark it with @RequestBean. In this release, a new CorsFilter class has been added that sends a 403 status code to origins other than localhost when the app runs on localhost. This is intended to protect users against “drive-by localhost attacks” by enabling CORS from any origin on localhost.

Moreover, this release adds support for Azure Cosmos and gives Micronaut Data two new ways to handle multiple tenants. On the other hand, Micronaut Security has been improved with some ahead-of-time optimizations that speed up the time-to-first response and add support for Proof Key for Code Exchange (PKCE). Micronaut Security has also made way for getting OpenID Connect metadata to work without stopping the Netty event loop.

Furthermore, this release brings forth a new command called, mn create-aws-lambda, which allows users to create a Micronaut AWS Lambda project through an interactive prompt. Also, Micronaut Launch and CLI now have more features, such as support for the gitlab-workflow-ci, azure-cosmos-db, localstack and aws-alexa,aws-cdk features. In addition, the Micronaut Maven Plugin has been improved with faster start/stop of test resources, the ability to choose a namespace for shared test resources, and the addition of the CRaC packaging type to create checkpointed Docker images. With these updates, developers will have even more tools to use with Micronaut to make strong, scalable apps.

A new version of its CRaC (Coordinated Restore at Checkpoint) feature has also been released. The update adds support for HikariCP, a popular JDBC connection pool. With this update, developers can now use either the Micronaut Gradle CRaC Plugin or the Micronaut Maven Plugin to build Docker images with a CRaC-enabled JDK and a pre-warmed, checkpointed application. Additionally, Micronaut CRaC can now be used in combination with AWS Lambda SnapStart. These updates will allow developers to create more efficient and scalable applications with Micronaut.

Nonetheless, this release has updates for its cloud offerings, including support for AWS, Azure, GCP, Oracle, and Reactor. Updates to Micronaut AWS include the ability to change the endpoint for the AWS Services SDK and updates to dependencies like the AWS CDK and AWS SDK. Micronaut Azure has been updated to the latest Azure SDK and Azure Functions Java version. In contrast, Micronaut GCP has added support for Google Cloud Events and updated dependencies such as Google Cloud PubSub and Google Secret Manager. Micronaut Oracle now supports Oracle Cloud Infrastructure (OCI) SDK v3, and Project Reactor 3.5.0 has been added to Micronaut Reactor.

Additionally, Micronaut Test has received updates to its dependencies, including JUnit and Mockito. Finally, Micronaut Test Resources has added support for wait strategies and a method to get the TestResourcesClient from an ApplicationContext. These updates will enhance the functionality and performance of applications built with Micronaut.

Developers who want to evaluate Micronaut 3.8.0 can also build applications from Micronaut Launch and read reference material to learn more.

About the Author

Subscribe for MMS Newsletter

By signing up, you will receive updates about our latest information.

  • This field is for validation purposes and should be left unchanged.