Micronaut java full stack Microservice Framework!!

Learner, Love to make things simple, Full Stack Developer, StackOverflower, Passionate about using machine learning, deep learning and AI
Search for a command to run...

Learner, Love to make things simple, Full Stack Developer, StackOverflower, Passionate about using machine learning, deep learning and AI
No comments yet. Be the first to comment.
Move beyond traditional RESTful thinking. Learn how to design APIs specifically for MCP (Model Context Protocol) servers. This guide covers the shift in mindset, a practical OpenAPI 3.1 example, and a Spring Boot implementation to make your services ...

Extending Kestra to Every Corner of Your Data Stack. Introduction: The Power of Plugins Imagine you're a master chef. You don't just have one knife - you have specialized tools for every task: a paring knife for delicate work, a chef's knife for chop...
Mastering Complex Orchestration Scenarios. Introduction: The Orchestrator's Toolkit Imagine you're conducting a symphony. You don't just wave your baton - you cue sections, adjust tempo, handle surprises, and ensure harmony. That's what advanced work...
From Data Extraction to Loading - A Practical Guide Introduction: Why ETL Still Matters in the Modern Data Stack Remember when data engineering was "extract, transform, load"? Some say ETL is dead, replaced by ELT, reverse ETL, and data mesh. But her...
Building Blocks of Declarative Orchestration. Introduction: The Power of Simplicity Imagine trying to build a house without understanding bricks, beams, and blueprints. That's what using an orchestration tool without understanding its core concepts f...
Micronaut is a modern, JVM-based, full-stack microservices framework designed for building modular, easily testable microservice applications.

Micronaut is the latest framework designed to make creating microservices quick and easy.
Micronaut is a JVM-based framework for building lightweight, modular applications. Developed by OCI, the same company that created Grails. Micronaut is developed by the creators of the Grails framework and takes inspiration from lessons learned over the years building real-world applications from monoliths to microservices using Spring, Spring Boot, and Grails.
Micronaut supports Java, Groovy, or Kotlin.
One of the most exciting features of Micronaut is its compile-time dependency injection mechanism. If you know the spring boot mostly uses reflection API and proxies which is always at a run time causing the spring boot application to need more startup time as compared to the Node application.
Disclaimer There is nothing wrong with the spring boot. I am a very big fan of spring projects including spring, Spring Boot, Spring Data, etc. Spring Boot is a good and very elegant solution and it makes the developer's job easier than anything, just add one dependency and magic will happen for you.
When spring is providing things on your fingertip that means spring is doing so many things under the hood for you. Spring does reflection, proxy classes, injection, and many more and for this, you have to pay the cost because spring does things at runtime. You have to pay in terms of memory, CPU cycles, and application bootstrap time.
Micronaut addressed some of these problems using ATC (Ahead of time compilation), GraalVM. Micronaut does major things at compile time that reduces memory footprint and CPU utilization which leads to reduce in application bootstrap time. Currently, spring is not supporting GraalVM and Micronaut is supporting this is also a big difference.
GraalVM is basically a high-performance polyglot VM. GraalVM is a universal virtual machine for running applications written in JavaScript, Python, Ruby, R, JVM-based languages like Java, Scala, Groovy, Kotlin, Clojure, and LLVM-based languages such as C and C++.
Now we know what is and why Micronaut and a couple of features. Let us setup Micronaut and we will create one simple Hello world application.
To install or set up Micronauts is a very easy task. Go to this page https://micronaut.io/download.html
Either you can download binary, or use SDKMAN to set up micronaut on your favorite OS.
Using SDKMAN
Simply open a new terminal and start:
$ curl -s https://get.sdkman.io | bash
$ source “$HOME/.sdkman/bin/sdkman-init.sh”
$ sdk install micronaut
$ mn — version
Now installation is done let us create a simple Hello world application.
mn create-app hello-world
By Default Micronaut uses Gradle as a build tool you can also specify maven as well.
mn create-app hello-world --build maven
Using Homebrew
Before installing make sure you have the latest Homebrew installed.
$ brew update
$ brew install micronaut
Using Binary on windows
Now enjoy the coding.
Let us have a HelloWorld controller
import io.micronaut.http.MediaType;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;
@Controller("/hello")
public class HelloController
{
@Get(produces = MediaType.TEXT_PLAIN)
public String index()
{
return "Hello World";
}
}
$ curl http://localhost:8080/hello
Hello World
Spring boot and micronaut both have some pros and cons. As per my understanding if you are developing a new greenfield application start with micronaut but don’t rewrite the existing application of spring boot to micronaut unless and until you are facing some serious performance issues. If you are migrating from monolith to cloud-native microservice then micronaut is a good option. Please let us know your thoughts on this.
This is the performance comparison between spring boot and micronaut.
https://docs.micronaut.io/latest/guide/index.html
https://piotrminkowski.com/2019/04/09/performance-comparison-between-spring-boot-and-micronaut/
More such articles:
https://www.youtube.com/channel/UCiTaHm1AYqMS4F4L9zyO7qA
==========================**=========================
If this article adds any value for you then please clap and comment.
Let’s connect on Stackoverflow, LinkedIn, & Twitter.