SlideShare una empresa de Scribd logo
1 de 30
Descargar para leer sin conexión
GETTINGGROOVY
WITH MICRONAUT & JHIPSTER
Web and JVM developer with a decade of
experience
Husband of Dad of
OSS contributor
2GM Team Member at OCI
ABOUTME
ZACHARY KLEIN, SENIOR SOFTWARE ENGINEER
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
💇 🙆 👸 👶🙋
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
AGENDA
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
WHATISMICRONAUT?
• A framework for microservice & serverless applications
• Leverages Ahead Of Time (AOT) for DI, AOP, and
configuration injection
• Reactive HTTP layer built on Netty
• Declarative HTTP Client
• “Natively Cloud Native”
• Accompanied by a suite of official and community-
contributed integrations and libraries
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
WHATCANYOUBUILDWITHMICRONAUT?
• Microservices
• Serverless Applications
• Message-Driven Applications with Kafka/Rabbit
• CLI Applications
• Android Applications
• Anything with static void main(String..args)
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
WHATMAKESMICRONAUTDIFFERENT?
• Ahead of Time (AOT) Compilation
• No Reflection, Runtime Proxies, or Dynamic Classloading
• Optimized for GraalVM (and standard JVM)
• Natively Reactive
• Capable of running in low-memory environments with sub
second startup time
• Polyglot: supports Java, Kotlin, and Groovy
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
WHATMAKESMICRONAUTDIFFERENT?
• Configurations offered for…
• Cloud platforms (AWS, Google Cloud, Microsoft Azure)
• Messaging frameworks (Kafka, RabbitMQ, nats.io)
• Data access (MongoDB, Neo4j, Redis, SQL/JDBC, Cassandra
• Open API documentation (Swagger)
• Metrics libraries (Micrometer, rate limiting libraries)
• Server-side view rendering
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
MICRONAUTANDGROOVY
• First-class support for Groovy
• Controllers, filters, beans, factories, configuration
• @MicronautTest for Spock
• AST Transformations
• Static Compilation
• Interoperability
https://launch.micronaut.io9
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
DEPENDENCYINJECTION&AOP
• Full Featured Dependency Injection (DI) Container
• JSR-330 Compliant
• Minimizes Runtime Reflection
• AOP APIs
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
Generated Bytecode resides in
the same package as your source
code - your code is never altered
by Micronaut
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
import javax.inject.Singleton
@Singleton
class MessageHelper {
String createMessage() { // … }
}
Mind the package!
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
import io.micronaut.http.annotation.Controller
import io.micronaut.http.annotation.Get
import javax.inject.Inject
@Controller("/")
class HelloController {
@Inject
MessageHelper messageHelper
// ...
}
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
import io.micronaut.http.annotation.Controller
import io.micronaut.http.annotation.Get
@Controller("/")
class HelloController {
MessageHelper messageHelper
public HelloController(MessageHelper messageHelper) {
this.messageHelper = messageHelper
}
// ...
}
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
CONFIGURATION
• Configuration formats: YML (default), Groovy, JSON, Java
Properties
• Environment detection and env-specific config
• Configuration injection via annotations or
@ConfigurationProperties
info.demo.string = "demo string"
info.demo.number = 123
info.demo.map = [key: 'value',
other_key: 123]
application.groovy
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
CONTROLLERS
package example
import io.micronaut.http.annotation.Controller
import io.micronaut.http.annotation.Get
@Controller('/')
class GroovyHelloController {
@Get('/hello/{name}')
String hello(String name) {
"Hello $name From Groovy"
}
}
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
CLIENTS
package example
import io.micronaut.http.annotation.Controller
import io.micronaut.http.annotation.Get
@Client(‘/') // or (id = ‘service-id’)
class GroovyHelloClient {
@Get('/hello/{name}')
String hello(String name)
}
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
MANAGEMENTENDPOINTS
• Provided by the micronaut-management library
• Similar conceptually to Actuator endpoints in Spring
Boot/Grails
• Endpoints can be defined as sensitive (requiring
authentication)
• Support GET, POST, and DELETE requests
• Can be exposed via JMX
• Custom endpoints supported
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
/beans Returns information about the loaded bean definitions in
the application
/info Returns static information from the state of the
application
/health Returns information about the "health" of the application
/metrics Return the application metrics. Requires the micrometer-
core configuration on the classpath
/refresh Refreshes bean state
/routes Returns information about URIs available to be called for
your application
/stop Shuts down the application server (disabled by default)
/loggers View and mutate logging configuration (e.g, POST to change
log levels at runtime)
/env Returns all currently resolved configuration properties
DEFAULT MANAGEMENT ENDPOINTS
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
MICRONAUT&GROOVY
• Groovy is a 1st class language in Micronaut!
• Applications can be generated with Groovy
as the default language (e.g, code-gen for
controllers, clients, Application class, etc)
• Groovy supported as configuration syntax
• Compile-time DI/AOP provided using Groovy
AST Transformations
• Groovy classes can also be used within Java
Micronaut apps (e.g, Spock tests, helper/util
classes)
❤
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
MICRONAUT&GROOVY
• Groovy can be used for:
• Controllers & Clients
• Filters
• All bean types
• AOP advice
• Configuration
• Serverless functions
❤
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
“ADEVELOPMENTPLATFORMTO
QUICKLYGENERATE,DEVELOP,&
DEPLOYMODERNWEBAPPLICATIONS
&MICROSERVICEARCHITECTURES.”
HTTPS://WWW.JHIPSTER.TECH
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
WHATISJHIPSTER?
• Project generator for modern JVM web apps
• Originally designed for Spring Boot and Angular
• Now supports React and Vue.js frontends, and Micronaut as a
backend via the Hipster blueprint
• Provides user admin UI, management UI, and “scaffolding” views for
database entities
• Offers features to easily enable OAuth2 authentication
• JDL (JHipster Domain Language) can be used to define the domain
model (and project options) for your app
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
JHIPSTER&MICRONAUT
• Development sponsored by Object Computing, Inc
• Custom Blueprint supplies a Micronaut backend
• Still in active development!
• Features currently supported include:
• Maven (default) or Gradle
• MySQL, Postgres, H2
• JWT or OAuth 2.0 authentication
• Angular or React client app
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
CREATINGAJHIPSTERAPPLICATION
1. Install MHipster
◦ npm install -g generator-jhipster-micronaut
2. Create a new folder for your application
3. Start MHipster
◦ mhipster
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
JHIPSTER/MICRONAUT+GROOVY!
• JHipster projects use Java only by default, :( however…
• Groovy can be added to the project with fairly minimal build
configuration! :)
• Groovy can be used for project configuration (?)
• Micronaut’s joint-compilation support for Groovy allows
bidirectional DI within your app
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
DEMO!DEMO!DEMO!
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
WRAPUP
• Micronaut is a powerful, performant framework for JVM apps -
including Groovy!
• JHipster allows you to quickly bootstrap a full-featured
application with Micronaut with very little coding
• With a bit of custom config, you can take advantage of Groovy
and Micronaut’s support for the Groovy language within your
JHipster project
• Approach is applicable to any Micronaut project (not just
JHipster)
❤
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
QUESTIONS?
ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020
THANKYOU
ZACHARY KLEIN
SENIOR SOFTWARE ENGINEER
GRAILS & MICRONAUT CORE TEAM MEMBER
KLEINZ@OBJECTCOMPUTING.COM
@ZACHARYAKLEIN
https://micronaut.io
https://objectcomputing.com/resources/events
SAMPLE CODE: HTTPS://GITHUB.COM/ZACHARYKLEIN/GROOVY-JHIPSTER

Más contenido relacionado

La actualidad más candente

Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019Matt Raible
 
GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf
 
Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019
Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019
Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019Matt Raible
 
Bringing Docker to the Cloud
Bringing Docker to the CloudBringing Docker to the Cloud
Bringing Docker to the CloudAndrew Kennedy
 
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021Matt Raible
 
Spark IT 2011 - Developing RESTful Web services with JAX-RS
Spark IT 2011 - Developing RESTful Web services with JAX-RSSpark IT 2011 - Developing RESTful Web services with JAX-RS
Spark IT 2011 - Developing RESTful Web services with JAX-RSArun Gupta
 
A realtime infrastructure for Android apps: Firebase may be what you need..an...
A realtime infrastructure for Android apps: Firebase may be what you need..an...A realtime infrastructure for Android apps: Firebase may be what you need..an...
A realtime infrastructure for Android apps: Firebase may be what you need..an...Alessandro Martellucci
 
Bootiful Development with Spring Boot and React - Richmond JUG 2018
Bootiful Development with Spring Boot and React - Richmond JUG 2018Bootiful Development with Spring Boot and React - Richmond JUG 2018
Bootiful Development with Spring Boot and React - Richmond JUG 2018Matt Raible
 
Open Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpOpen Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpToshiaki Maki
 
Seven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuseSeven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuseMatt Raible
 
Micronaut: A new way to build microservices
Micronaut: A new way to build microservicesMicronaut: A new way to build microservices
Micronaut: A new way to build microservicesLuram Archanjo
 
JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011Shreedhar Ganapathy
 
Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015Daniel Woods
 
Spring Up Your Graph
Spring Up Your GraphSpring Up Your Graph
Spring Up Your GraphVMware Tanzu
 
Implement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyoImplement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyoToshiaki Maki
 
Developing modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsDeveloping modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsShekhar Gulati
 
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)Tsuyoshi Miyake
 
Java Web Application Security - UberConf 2011
Java Web Application Security - UberConf 2011Java Web Application Security - UberConf 2011
Java Web Application Security - UberConf 2011Matt Raible
 
A friend in need - A JS indeed
A friend in need - A JS indeedA friend in need - A JS indeed
A friend in need - A JS indeedYonatan Levin
 
Html5 with Vaadin and Scala
Html5 with Vaadin and ScalaHtml5 with Vaadin and Scala
Html5 with Vaadin and ScalaJoonas Lehtinen
 

La actualidad más candente (20)

Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019Get Hip with JHipster - GIDS 2019
Get Hip with JHipster - GIDS 2019
 
GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug in
 
Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019
Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019
Microservices for the Masses with Spring Boot, JHipster and OAuth - GIDS 2019
 
Bringing Docker to the Cloud
Bringing Docker to the CloudBringing Docker to the Cloud
Bringing Docker to the Cloud
 
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
 
Spark IT 2011 - Developing RESTful Web services with JAX-RS
Spark IT 2011 - Developing RESTful Web services with JAX-RSSpark IT 2011 - Developing RESTful Web services with JAX-RS
Spark IT 2011 - Developing RESTful Web services with JAX-RS
 
A realtime infrastructure for Android apps: Firebase may be what you need..an...
A realtime infrastructure for Android apps: Firebase may be what you need..an...A realtime infrastructure for Android apps: Firebase may be what you need..an...
A realtime infrastructure for Android apps: Firebase may be what you need..an...
 
Bootiful Development with Spring Boot and React - Richmond JUG 2018
Bootiful Development with Spring Boot and React - Richmond JUG 2018Bootiful Development with Spring Boot and React - Richmond JUG 2018
Bootiful Development with Spring Boot and React - Richmond JUG 2018
 
Open Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpOpen Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjp
 
Seven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuseSeven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuse
 
Micronaut: A new way to build microservices
Micronaut: A new way to build microservicesMicronaut: A new way to build microservices
Micronaut: A new way to build microservices
 
JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011
 
Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015
 
Spring Up Your Graph
Spring Up Your GraphSpring Up Your Graph
Spring Up Your Graph
 
Implement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyoImplement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyo
 
Developing modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsDeveloping modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular js
 
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
 
Java Web Application Security - UberConf 2011
Java Web Application Security - UberConf 2011Java Web Application Security - UberConf 2011
Java Web Application Security - UberConf 2011
 
A friend in need - A JS indeed
A friend in need - A JS indeedA friend in need - A JS indeed
A friend in need - A JS indeed
 
Html5 with Vaadin and Scala
Html5 with Vaadin and ScalaHtml5 with Vaadin and Scala
Html5 with Vaadin and Scala
 

Similar a Getting Groovy with JHipster and Micronaut

Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
Native Cloud-Native: Building Agile Microservices with the Micronaut FrameworkNative Cloud-Native: Building Agile Microservices with the Micronaut Framework
Native Cloud-Native: Building Agile Microservices with the Micronaut FrameworkZachary Klein
 
week 4_watermark.pdfffffffffffffffffffff
week 4_watermark.pdfffffffffffffffffffffweek 4_watermark.pdfffffffffffffffffffff
week 4_watermark.pdfffffffffffffffffffffanushka2002ece
 
Week 4 lecture material cc (1)
Week 4 lecture material cc (1)Week 4 lecture material cc (1)
Week 4 lecture material cc (1)Ankit Gupta
 
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...Oleg Shalygin
 
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891Cisco DevNet
 
Spring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugSpring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugToshiaki Maki
 
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020Matt Raible
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Pythonwesley chun
 
Masterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM RolesMasterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM RolesMalcolm Duncanson, CISSP
 
Intro to Spring Boot and Spring Cloud OSS - Twin Cities Cloud Foundry Meetup
Intro to Spring Boot and Spring Cloud OSS - Twin Cities Cloud Foundry MeetupIntro to Spring Boot and Spring Cloud OSS - Twin Cities Cloud Foundry Meetup
Intro to Spring Boot and Spring Cloud OSS - Twin Cities Cloud Foundry MeetupJosh Ghiloni
 
How to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native ApplicationsHow to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native ApplicationsSufyaan Kazi
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Matt Raible
 
Building Microservices with Micronaut: A Full-Stack JVM-Based Framework
Building Microservices with Micronaut:  A Full-Stack JVM-Based FrameworkBuilding Microservices with Micronaut:  A Full-Stack JVM-Based Framework
Building Microservices with Micronaut: A Full-Stack JVM-Based FrameworkMichael Redlich
 
Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Matt Raible
 
Spring Native and Spring AOT
Spring Native and Spring AOTSpring Native and Spring AOT
Spring Native and Spring AOTVMware Tanzu
 
Kubernetes Operability Tooling (GOTO Chicago 2019)
Kubernetes Operability Tooling (GOTO Chicago 2019)Kubernetes Operability Tooling (GOTO Chicago 2019)
Kubernetes Operability Tooling (GOTO Chicago 2019)bridgetkromhout
 
Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...Henning Jacobs
 
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024Cloud Native NoVA
 
Develop Azure compute solutions Part - 2
Develop Azure compute solutions Part - 2Develop Azure compute solutions Part - 2
Develop Azure compute solutions Part - 2AzureEzy1
 

Similar a Getting Groovy with JHipster and Micronaut (20)

Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
Native Cloud-Native: Building Agile Microservices with the Micronaut FrameworkNative Cloud-Native: Building Agile Microservices with the Micronaut Framework
Native Cloud-Native: Building Agile Microservices with the Micronaut Framework
 
week 4_watermark.pdfffffffffffffffffffff
week 4_watermark.pdfffffffffffffffffffffweek 4_watermark.pdfffffffffffffffffffff
week 4_watermark.pdfffffffffffffffffffff
 
Week 4 lecture material cc (1)
Week 4 lecture material cc (1)Week 4 lecture material cc (1)
Week 4 lecture material cc (1)
 
First Bucharest GTUG event 02 Mar 2010
First Bucharest GTUG event 02 Mar 2010First Bucharest GTUG event 02 Mar 2010
First Bucharest GTUG event 02 Mar 2010
 
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
 
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
 
Spring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugSpring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsug
 
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Python
 
Masterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM RolesMasterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM Roles
 
Intro to Spring Boot and Spring Cloud OSS - Twin Cities Cloud Foundry Meetup
Intro to Spring Boot and Spring Cloud OSS - Twin Cities Cloud Foundry MeetupIntro to Spring Boot and Spring Cloud OSS - Twin Cities Cloud Foundry Meetup
Intro to Spring Boot and Spring Cloud OSS - Twin Cities Cloud Foundry Meetup
 
How to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native ApplicationsHow to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native Applications
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
Building Microservices with Micronaut: A Full-Stack JVM-Based Framework
Building Microservices with Micronaut:  A Full-Stack JVM-Based FrameworkBuilding Microservices with Micronaut:  A Full-Stack JVM-Based Framework
Building Microservices with Micronaut: A Full-Stack JVM-Based Framework
 
Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021
 
Spring Native and Spring AOT
Spring Native and Spring AOTSpring Native and Spring AOT
Spring Native and Spring AOT
 
Kubernetes Operability Tooling (GOTO Chicago 2019)
Kubernetes Operability Tooling (GOTO Chicago 2019)Kubernetes Operability Tooling (GOTO Chicago 2019)
Kubernetes Operability Tooling (GOTO Chicago 2019)
 
Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...
 
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
 
Develop Azure compute solutions Part - 2
Develop Azure compute solutions Part - 2Develop Azure compute solutions Part - 2
Develop Azure compute solutions Part - 2
 

Último

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Último (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Getting Groovy with JHipster and Micronaut

  • 2. Web and JVM developer with a decade of experience Husband of Dad of OSS contributor 2GM Team Member at OCI ABOUTME ZACHARY KLEIN, SENIOR SOFTWARE ENGINEER ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 💇 🙆 👸 👶🙋
  • 3. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 AGENDA
  • 4. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 WHATISMICRONAUT? • A framework for microservice & serverless applications • Leverages Ahead Of Time (AOT) for DI, AOP, and configuration injection • Reactive HTTP layer built on Netty • Declarative HTTP Client • “Natively Cloud Native” • Accompanied by a suite of official and community- contributed integrations and libraries
  • 5. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 WHATCANYOUBUILDWITHMICRONAUT? • Microservices • Serverless Applications • Message-Driven Applications with Kafka/Rabbit • CLI Applications • Android Applications • Anything with static void main(String..args)
  • 6. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 WHATMAKESMICRONAUTDIFFERENT? • Ahead of Time (AOT) Compilation • No Reflection, Runtime Proxies, or Dynamic Classloading • Optimized for GraalVM (and standard JVM) • Natively Reactive • Capable of running in low-memory environments with sub second startup time • Polyglot: supports Java, Kotlin, and Groovy
  • 7. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 WHATMAKESMICRONAUTDIFFERENT? • Configurations offered for… • Cloud platforms (AWS, Google Cloud, Microsoft Azure) • Messaging frameworks (Kafka, RabbitMQ, nats.io) • Data access (MongoDB, Neo4j, Redis, SQL/JDBC, Cassandra • Open API documentation (Swagger) • Metrics libraries (Micrometer, rate limiting libraries) • Server-side view rendering
  • 8. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 MICRONAUTANDGROOVY • First-class support for Groovy • Controllers, filters, beans, factories, configuration • @MicronautTest for Spock • AST Transformations • Static Compilation • Interoperability
  • 10. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 DEPENDENCYINJECTION&AOP • Full Featured Dependency Injection (DI) Container • JSR-330 Compliant • Minimizes Runtime Reflection • AOP APIs
  • 11. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 Generated Bytecode resides in the same package as your source code - your code is never altered by Micronaut
  • 12. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 import javax.inject.Singleton @Singleton class MessageHelper { String createMessage() { // … } } Mind the package!
  • 13. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 import io.micronaut.http.annotation.Controller import io.micronaut.http.annotation.Get import javax.inject.Inject @Controller("/") class HelloController { @Inject MessageHelper messageHelper // ... }
  • 14. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 import io.micronaut.http.annotation.Controller import io.micronaut.http.annotation.Get @Controller("/") class HelloController { MessageHelper messageHelper public HelloController(MessageHelper messageHelper) { this.messageHelper = messageHelper } // ... }
  • 15. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 CONFIGURATION • Configuration formats: YML (default), Groovy, JSON, Java Properties • Environment detection and env-specific config • Configuration injection via annotations or @ConfigurationProperties info.demo.string = "demo string" info.demo.number = 123 info.demo.map = [key: 'value', other_key: 123] application.groovy
  • 16. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 CONTROLLERS package example import io.micronaut.http.annotation.Controller import io.micronaut.http.annotation.Get @Controller('/') class GroovyHelloController { @Get('/hello/{name}') String hello(String name) { "Hello $name From Groovy" } }
  • 17. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 CLIENTS package example import io.micronaut.http.annotation.Controller import io.micronaut.http.annotation.Get @Client(‘/') // or (id = ‘service-id’) class GroovyHelloClient { @Get('/hello/{name}') String hello(String name) }
  • 18. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 MANAGEMENTENDPOINTS • Provided by the micronaut-management library • Similar conceptually to Actuator endpoints in Spring Boot/Grails • Endpoints can be defined as sensitive (requiring authentication) • Support GET, POST, and DELETE requests • Can be exposed via JMX • Custom endpoints supported
  • 19. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 /beans Returns information about the loaded bean definitions in the application /info Returns static information from the state of the application /health Returns information about the "health" of the application /metrics Return the application metrics. Requires the micrometer- core configuration on the classpath /refresh Refreshes bean state /routes Returns information about URIs available to be called for your application /stop Shuts down the application server (disabled by default) /loggers View and mutate logging configuration (e.g, POST to change log levels at runtime) /env Returns all currently resolved configuration properties DEFAULT MANAGEMENT ENDPOINTS
  • 20. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 MICRONAUT&GROOVY • Groovy is a 1st class language in Micronaut! • Applications can be generated with Groovy as the default language (e.g, code-gen for controllers, clients, Application class, etc) • Groovy supported as configuration syntax • Compile-time DI/AOP provided using Groovy AST Transformations • Groovy classes can also be used within Java Micronaut apps (e.g, Spock tests, helper/util classes) ❤
  • 21. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 MICRONAUT&GROOVY • Groovy can be used for: • Controllers & Clients • Filters • All bean types • AOP advice • Configuration • Serverless functions ❤
  • 22. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 “ADEVELOPMENTPLATFORMTO QUICKLYGENERATE,DEVELOP,& DEPLOYMODERNWEBAPPLICATIONS &MICROSERVICEARCHITECTURES.” HTTPS://WWW.JHIPSTER.TECH
  • 23. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 WHATISJHIPSTER? • Project generator for modern JVM web apps • Originally designed for Spring Boot and Angular • Now supports React and Vue.js frontends, and Micronaut as a backend via the Hipster blueprint • Provides user admin UI, management UI, and “scaffolding” views for database entities • Offers features to easily enable OAuth2 authentication • JDL (JHipster Domain Language) can be used to define the domain model (and project options) for your app
  • 24. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 JHIPSTER&MICRONAUT • Development sponsored by Object Computing, Inc • Custom Blueprint supplies a Micronaut backend • Still in active development! • Features currently supported include: • Maven (default) or Gradle • MySQL, Postgres, H2 • JWT or OAuth 2.0 authentication • Angular or React client app
  • 25. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 CREATINGAJHIPSTERAPPLICATION 1. Install MHipster ◦ npm install -g generator-jhipster-micronaut 2. Create a new folder for your application 3. Start MHipster ◦ mhipster
  • 26. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 JHIPSTER/MICRONAUT+GROOVY! • JHipster projects use Java only by default, :( however… • Groovy can be added to the project with fairly minimal build configuration! :) • Groovy can be used for project configuration (?) • Micronaut’s joint-compilation support for Groovy allows bidirectional DI within your app
  • 27. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 DEMO!DEMO!DEMO!
  • 28. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 WRAPUP • Micronaut is a powerful, performant framework for JVM apps - including Groovy! • JHipster allows you to quickly bootstrap a full-featured application with Micronaut with very little coding • With a bit of custom config, you can take advantage of Groovy and Micronaut’s support for the Groovy language within your JHipster project • Approach is applicable to any Micronaut project (not just JHipster) ❤
  • 29. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 QUESTIONS?
  • 30. ZACHARY KLEIN - APACHECON @HOME - SEPTEMBER 30, 2020 THANKYOU ZACHARY KLEIN SENIOR SOFTWARE ENGINEER GRAILS & MICRONAUT CORE TEAM MEMBER KLEINZ@OBJECTCOMPUTING.COM @ZACHARYAKLEIN https://micronaut.io https://objectcomputing.com/resources/events SAMPLE CODE: HTTPS://GITHUB.COM/ZACHARYKLEIN/GROOVY-JHIPSTER