Sample code is available at https://github.com/alvarosanchez/commit-conf-2018
Micronaut es un framework basado en la JVM para crear microservicios reactivos en Java, Groovy y Kotlin. Micronaut es desarrollado por los creadores de Grails, y toma inspiraciones de las lecciones aprendidas durante 10 años construyendo un framework basado en Spring.
Micronaut fue presentado en marzo de 2018, y su primera release fue a finales de mayo, tras casi 2 años de desarrollo por parte de del equipo de Object Computing, Inc.
En esta sesión se explicarán las características principales del framework:
Dependency Injection and Inversion of Control (IoC).
Configuration system.
HTTP services.
Cloud and serverless deployments.
Management & Monitoring.
2. About me
— Developer since 2001 (Java / Spring stack).
— Former BEA Systems
⚰
and Sun Microsystems
— Founded Salenda in 2007. Left in 2013.
— Working @ OCI since 2015: Groovy, Grails & Micronaut!
— Speaker at conferences like Devoxx, GeeCON,
JavaLand, JavaZone, Codemotion, Commit Conf and
Spring IO.
$ % & ' ( ) * + , -
@alvaro_sanchez
4. Introducing Micronaut
The productivity of Spring Boot / Grails with the
performance of a compile-time, non-blocking
framework.
— Designed from the ground up with microservices and the
cloud in mind ("Natively Cloud Native").
— Ultra-lightweight and Reactive (based on Netty)
— Integrated AOP and Compile-Time DI for Java, Groovy and
Kotlin.
@alvaro_sanchez
5. What Spring and Jakarta EE Do
Spring is an amazing technical achievement and does so
many things, but does them at Runtime.
— Reads the byte code of every bean it finds
— Synthesizes new annotations for each annotation on
each bean method, constructor, field etc. to support
Annotation metadata
— Builds Reflective Metadata for each bean for every
method, constructor, field etc.
@alvaro_sanchez
6. Micronaut's approach
— Ahead of time (AOT) compilation.
— Annotation processors (APT) for Java and Kotlin.
— AST Transformations for Groovy.
— All Dependency & Configuration Injection.
— Annotation Metadata (Meta annotations) and AOP
proxies.
— Essentially all framework infrastructure (what Spring/
CDI do at runtime).
@alvaro_sanchez
7. Micronaut is small and fast!
— JAR files: 8Mb (Java) / 12Mb (Groovy).
— Spring+Groovy: 36MB / Grails: 27Mb.
— Heap size: 7Mb (Java) / 19Mb (Groovy).
— Spring+Groovy: 33Mb / Grails: 49Mb.
— Startup time: ~1 second.
— Spring / Grails: ~3-4 seconds.
@alvaro_sanchez
9. It can be even faster with GraalVM!
— New Polyglot VM from Oracle.
— Runs JS, Java, Ruby, R etc.
— Ability to turn Java code into native images.
$ ./hello-world
15:15:15.153 [main] INFO io.micronaut.runtime.Micronaut - Startup completed in 14ms. Server Running: http://localhost:8080
@alvaro_sanchez
11. Micronaut is open source!
— Licensed under the Apache License v2.
— Commercial support and training offers available from
Object Computing, Inc (OCI).
— ~1.5 years of development by several OCI engineers.
— 70 contributors (19 from OCI).
— ~1300 stars on GitHub.
@alvaro_sanchez