Slide 1

Slide 1 text

Bratislava, Slovakia. June 3-5, 2024 Getting Started with the Micronaut Framework Sergio del Amo Caballero

Slide 2

Slide 2 text

Copyright © 2024 by Micronaut Foundation All rights reserved. Sergio del Amo https://sergiodelamo.com @sdelamo Member of the Micronaut Foundation Board of Directors Micronaut Developer Advocate Involved with Micronaut since its inception. Micronaut Core committer. Micronaut Guides. Micronaut Starter, Security, AWS, Views, RSS, Problem+JSON, Email, 2

Slide 3

Slide 3 text

Copyright © 2024 by Micronaut Framework All rights reserved. 3

Slide 4

Slide 4 text

Copyright © 2024 by Micronaut Framework All rights reserved. OPEN-SOURCE LICENSE 4 Apache 2.0

Slide 5

Slide 5 text

Copyright © 2024 by Micronaut Framework All rights reserved. LANGUAGE AGNOSTIC 5

Slide 6

Slide 6 text

Copyright © 2024 by Micronaut Framework All rights reserved. SUPPORTED JAVA VERSIONS 6 21 17

Slide 7

Slide 7 text

Copyright © 2024 by Micronaut Foundation All rights reserved. Modern JVM Framework ❖ Micronaut was designed from scratch in 2017, focused on modern architectures like microservices and serverless, with the cloud in mind. 7 All application types ❖ Micronaut is a complete solution for any type of application: microservices, message-driven producers or consumers, command-line apps, serverless functions Highly optimized ❖ Micronaut leverages Java annotation processors and other optimizations to compute the framework infrastructure at compile-time, drastically reducing startup time and memory consumption.

Slide 8

Slide 8 text

Copyright © 2024 by Micronaut Foundation All rights reserved. AOT: Ahead of Time Micronaut computes at build time: ‣ All dependency and configuration injection ‣ Annotation metadata (meta annotations) ‣ AOP proxies ‣ Bean introspections ‣ All other framework infrastructure At runtime ‣ No reflection. ‣ No proxy generation. ‣ No dynamic classloading. ‣ No classpath scanning. 8

Slide 9

Slide 9 text

Copyright © 2024 by Micronaut Foundation All rights reserved. Configuration Dependency Injection ❖ Can use JSR-330 (@Inject) annotations 9 ❖ Properties, YAML, TOML, Groovy, Config4K. Validation support ❖ Built-in reflection free, faster startup, smaller JAR, reduced memory. ❖ Hibernate Validation: full Bean Validation API compliance. AOP: Aspect-Oriented Programing ❖ Compile-time, reflection free. HTTP Client ❖ Micronaut includes an HTTP client that has both a low-level API and a higher-level AOP-driven API.

Slide 10

Slide 10 text

Copyright © 2024 by Micronaut Framework All rights reserved. BUILD AGNOSTIC 10

Slide 11

Slide 11 text

Copyright © 2024 by Micronaut Framework All rights reserved. TEST FRAMEWORK AGNOSTIC 11

Slide 12

Slide 12 text

Copyright © 2024 by Micronaut Framework All rights reserved. ❖ RxJava 2 ❖ RxJava 3 ❖ Project Reactor REACTIVE LIBRARY AGNOSTIC 12

Slide 13

Slide 13 text

Copyright © 2024 by Micronaut Framework All rights reserved. CLOUD AGNOSTIC 13

Slide 14

Slide 14 text

Copyright © 2024 by Micronaut Foundation All rights reserved. SERVERLESS 14

Slide 15

Slide 15 text

Copyright © 2024 by Micronaut Foundation All rights reserved. GRAALVM NATIVE IMAGE 15

Slide 16

Slide 16 text

Copyright © 2024 by Micronaut Framework All rights reserved. RUNTIMES 16 Servlet

Slide 17

Slide 17 text

Copyright © 2024 by Micronaut Framework All rights reserved. MESSAGING 17

Slide 18

Slide 18 text

Copyright © 2024 by Micronaut Framework All rights reserved. DATABASE MIGRATION TOOLS 18

Slide 19

Slide 19 text

Copyright © 2024 by Micronaut Framework All rights reserved. PERSISTENCE 19

Slide 20

Slide 20 text

Copyright © 2024 by Micronaut Framework All rights reserved. VIEWS 20 Server Side View Redendering Pebble Rocker Soy

Slide 21

Slide 21 text

Copyright © 2024 by Micronaut Framework All rights reserved. TRACING 21

Slide 22

Slide 22 text

Copyright © 2024 by Micronaut Framework All rights reserved. SERVICE DISCOVERY 22

Slide 23

Slide 23 text

Copyright © 2024 by Micronaut Framework All rights reserved. SECURITY 23 Security OAuth 2.0 OpenID Connect LDAP BasicAuth JWT

Slide 24

Slide 24 text

Copyright © 2024 by Micronaut Foundation All rights reserved. Error Handling ❖ Vnd.Error ❖ Problem+JSON 24

Slide 25

Slide 25 text

Copyright © 2024 by Micronaut Foundation All rights reserved. Monitoring ❖ Micrometer ❖ JMX 25 API ❖ GRAPHQL ❖ GRPC ❖ Open API Containers ❖ Kubernetes K8S MISC ❖ Cache ❖ Email ❖ Picocli ❖ RSS Search ❖ Elasticsearch ❖ OpenSearch

Slide 26

Slide 26 text

Copyright © 2024 by Micronaut Foundation All rights reserved. ROUTING ❖ @Controller ❖ @Get @Post @Patch @Update @Delete ❖ JAX-RS 26

Slide 27

Slide 27 text

© 2019, Object Computing, Inc. (OCI). All rights reserved. objectcomputing.com 27 Micronaut + Groovy ♥

Slide 28

Slide 28 text

© 2019, Object Computing, Inc. (OCI). All rights reserved. objectcomputing.com 28 MICRONAUT IS WRITTEN WITH JAVA. IT IS TESTED WITH SPOCK

Slide 29

Slide 29 text

© 2019, Object Computing, Inc. (OCI). All rights reserved. objectcomputing.com 29 MICRONAUT LAUNCH - GROOVY/SPOCK

Slide 30

Slide 30 text

© 2019, Object Computing, Inc. (OCI). All rights reserved. objectcomputing.com 30 MICRONAUT CLI - GROOVY/SPOCK

Slide 31

Slide 31 text

© 2019, Object Computing, Inc. (OCI). All rights reserved. objectcomputing.com 31 Groovy Specific Modules Dependency Description micronaut-inject-groovy Include AST transformations to generate bean definitions. Should be compileOnly on your classpath. micronaut-runtime-groovy Adds the ability to specify configuration placed in src/main/resources in Groovy format (i.e. application.groovy) micronaut-function-groovy Include AST transforms that make it easier to write Functions for AWS Lambda

Slide 32

Slide 32 text

© 2019, Object Computing, Inc. (OCI). All rights reserved. objectcomputing.com 32 Groovy Specific Modules

Slide 33

Slide 33 text

© 2019, Object Computing, Inc. (OCI). All rights reserved. objectcomputing.com 33 Singleton ⚠ Make sure to use jakarta.inject.Singleton when declaring a singleton bean. Groovy automatically imports groovy.lang.Singleton

Slide 34

Slide 34 text

Copyright © 2024 by Micronaut Foundation All rights reserved. DEMO 34

Slide 35

Slide 35 text

Copyright © 2024 by Micronaut Foundation All rights reserved. Q & A 35

Slide 36

Slide 36 text

Copyright © 2024 by Micronaut Foundation All rights reserved. RESOURCES ❖ https://micronaut.io ❖ https://docs.micronaut.io ❖ https://guides.micronaut.io ❖ https://micronaut.io/blog ❖ https://github.com/micronaut-projects ❖ https://micronaut.io/foundation ❖ https://micronaut.io/commercial-support 36