My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Micronaut 1.0

Micronaut 1.0

Pinei's photo
Pinei
·Nov 18, 2018

A modern, JVM-based, full-stack framework for building modular, easily testable microservice applications.

Micronaut is a new lightweight framework for creating microservices, cloud-native and serverless applications in Java, Groovy or Kotlin. It's leaded by Graeme Rocher, the main engineer behind Grails (another framework for the JVM).

The features includes:

  • GraalVM native image support
  • Ahead-of-Time (AOT) compilation with reflection-free dependency injection and AOP
  • Cloud-native configuration management
  • Microservice patterns such as service discovery, distributed tracing, circuit breaker and client-side load balancing
  • Integrated HTTP client and server-based Netty (a non-blocking web server)
  • Sensible defaults and auto configuration
  • Command Line Interface (CLI) and Micronaut shell
  • Common AST (abstract syntax tree) for each language (Java, Groovy, Kotlin)

Docker, Kubernetes and the Serverless movement are really optimized for low memory microservices and applications that have low overhead when it comes to cold starts. Languages like Go and Node are getting significant traction on those platforms over Java due to superior cold start performance and memory consumption.

package com.hello;

import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;
import io.micronaut.http.HttpStatus;

@Controller("/hello")
public class HelloController {

    @Get("/")
    public HttpStatus index() {
        return HttpStatus.OK;
    }
}

Projects like GraalVM have the potential to resolve these limitations by allowing Java applications to be compiled to a native image.

Micronaut is the basis for a framework for the Java future, resolving this tension by eliminating all use of reflection and producing all annotation metadata, proxies and framework infrastructure at compilation time through a set of annotation processors and AST transformations that perform Ahead-of-Time (AOT) compilation. What this allows Micronaut to achieve is fast startup time, low memory consumption and crucially improved compatibility with GraalVM native image.

Micronaut 1.0 GA was released in October 2018.