SlideShare una empresa de Scribd logo
1 de 26
Descargar para leer sin conexión
GRAILS 4 AND MICRONAUT
Getting the best out of Grails 4 and Micronaut
About Me
• Graeme Rocher
• Creator of Grails and Micronaut
• Principal Engineer at Object Computing
• Oracle Groundbreaker Award Winner
Agenda
• Introduction to Micronaut
• Introduction to Grails 4
• Grails vs Micronaut
• Using Micronaut Features in Grails
• Demos
Micronaut for Grails
Developers
• Micronaut a Foundational Library for
building applications of any type
• Focuses on Small Memory Footprint
and Speed
• Eliminates Reflection, Runtime
Proxies and Runtime Analysis
Why Micronaut?
• Micronaut is uses no reflection, no
runtime proxies, no runtime byte
code generation etc.
• Eliminating these leads to reduced
memory consumption and faster
startup
• Increasingly important for
Microservices, Serverless, IoT, any
low-memory footprint environment
Micronaut vs Grails
Micronaut Grails
Range of Runtimes Servlet Only
General Purpose Traditional Servlet Web Apps
DI, AOP etc. Spring for DI, AOP etc.
Java, Kotlin, Groovy, GraalVM Groovy Only
Client and Server Server Only
Grails 4 and
Micronaut
• Micronaut the Parent
ApplicationContext
• Made possible by
• http://github.com/micronaut-
projects/micronaut-spring
• Micronaut Libraries become usable
in Grails
• Anything we build for Micronaut
benefits Grails
What Can/Should
You Do
• Build Configurations (Instead of
Plugins)
• Use Declarative Clients
• HTTP
• Kafka
• RabbitMQ
Configurations vs
Plugins
• Consider Building Configurations
instead of Plugins
• Work with Micronaut, Spring (with
micronaut-spring) and Grails
• Plugins only work with Grails
• ... although some things only
possible with Plugins (Views, taglibs
etc.)
DEMOMicronaut Configurations with
Grails
Micronaut
Configurations
• Configuration with
@ConfigurationProperties
• Beans with @Singleton, @Factory
etc.
• Conditional Behaviour with
@Requires
• Customization with @Replaces
@ConfigurationProperties
Type Safe Configuration
@ConfigurationProperties("example")
class ExampleConfiguration {
String name
}
ApplicationContext context = ApplicationContext.run("example.name":"Demo")
FooConfiguration config = context.getBean(FooConfiguration)
assert config.name == 'Demo'
@Requires
Conditional Beans Made Easy
@Requires(property="example.enabled")
@Requires(beans=DataSource)
@Requires(missingBeans=Example)
@Singleton
class DefaultExampleBean implements Example {
...
}
def context = ApplicationContext.run("example.enabled":"true")
Example example = context.getBean(Example)
@Replaces
Easily Replace Beans by Type
@Replaces(DefaultExample)
@Singleton
class AlternativeExample implements Example {
...
}
• Types match much
• Beans annotated with @Infrastructure not replaceable
DEMOMicronaut HTTP Client
@Client
Declarative Compile Time HTTP Clients
@Client("https://api.github.com")
@Header(name="User-Agent", value="micronaut-client")
interface GithubClient {
@Get("/repos/{+slug}")
Info getInfo(String slug)
}
• Blocking or Non-Blocking (RxJava, Reactor or Future)
• Reflection / Runtime Proxy Free
@Client
• Uses Micronaut's low-level HTTP
client (RxHttpClient) under the
hood
• Built with Micronaut AOP (reflection/
runtime proxy free)
• Works on GraalVM nativeimage
• Integrates with Tracing, Metrics,
Service Discovery etc.
DEMOMicronaut Kafka Client
@KafkaClient
Declarative Compile Time Kafka Clients
@KafkaClient
public interface ProductClient {
@Topic("my-products")
void sendProduct(@KafkaKey String brand, String name);
}
• Blocking or Non-Blocking (RxJava, Reactor or Future)
https://github.com/micronaut-projects/micronaut-kafka
@RabbitClient
Declarative Compile Time Kafka Clients
@RabbitClient("animals")
interface AnimalClient {
void send(@Header String animalType, Animal animal)
}
• Blocking or Non-Blocking (RxJava, Reactor or Future)
https://github.com/micronaut-projects/micronaut-rabbitmq
Micronaut Message
Consumers
• Micronaut Supports Message-Drive
Microservices
• Can be run as standalone processes
(No HTTP server)
• Use @RabbitListener for Rabbit
• Use @KafkaListener for Kafka
https://docs.micronaut.io/1.1.x/guide/
index.html#messaging
Micronaut's Clients
• Compile Time
• Reflection and Runtime Proxy Free
• Java, Groovy or Kotlin
• Built with Micronaut AOP
https://docs.micronaut.io/1.1.x/guide/
index.html#aop
Summary
• Micronaut Provides an Awesome Foundation
• Building Blocks to Create Libraries, Configurations and
Clients
• Most Micronaut Features Available in Grails
• Build Micronaut Libraries not Plugins
Q & A
Grails 4 and Micronaut at Devnexus 2019
Grails 4 and Micronaut at Devnexus 2019

Más contenido relacionado

La actualidad más candente

Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»DataArt
 
Advance java session 2
Advance java session 2Advance java session 2
Advance java session 2Smita B Kumar
 
Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSPGary Yeh
 
Shootout! template engines on the jvm
Shootout! template engines on the jvmShootout! template engines on the jvm
Shootout! template engines on the jvmNLJUG
 
Introduction to Node.js Platform
Introduction to Node.js PlatformIntroduction to Node.js Platform
Introduction to Node.js PlatformNaresh Chintalcheru
 
No Container: a Modern Java Stack with Bootique
No Container: a Modern Java Stack with BootiqueNo Container: a Modern Java Stack with Bootique
No Container: a Modern Java Stack with BootiqueAndrus Adamchik
 
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013Sam Brannen
 
Byte code manipulation and instrumentalization in Java
Byte code manipulation and instrumentalization in JavaByte code manipulation and instrumentalization in Java
Byte code manipulation and instrumentalization in JavaAlex Moskvin
 
Node Web Development 2nd Edition: Chapter1 About Node
Node Web Development 2nd Edition: Chapter1 About NodeNode Web Development 2nd Edition: Chapter1 About Node
Node Web Development 2nd Edition: Chapter1 About NodeRick Chang
 
Asp.net mvc 5 course module 1 overview
Asp.net mvc 5 course   module 1 overviewAsp.net mvc 5 course   module 1 overview
Asp.net mvc 5 course module 1 overviewSergey Seletsky
 
Infinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum
 
3rd Generation Web Application Platforms
3rd Generation Web Application Platforms3rd Generation Web Application Platforms
3rd Generation Web Application PlatformsNaresh Chintalcheru
 
Fun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJBFun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJBArun Gupta
 
Microservices in Scala: Play Framework
Microservices in Scala: Play FrameworkMicroservices in Scala: Play Framework
Microservices in Scala: Play FrameworkŁukasz Sowa
 
Building and Managing Projects with Maven
Building and Managing Projects with MavenBuilding and Managing Projects with Maven
Building and Managing Projects with MavenKhan625
 
Run-time of Node.js : V8 JavaScript Engine
Run-time of Node.js: V8 JavaScript EngineRun-time of Node.js: V8 JavaScript Engine
Run-time of Node.js : V8 JavaScript EngineGary Yeh
 
Alfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCFAlfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCFPiergiorgio Lucidi
 

La actualidad más candente (20)

Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
 
Advance java session 2
Advance java session 2Advance java session 2
Advance java session 2
 
Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSP
 
Shootout! template engines on the jvm
Shootout! template engines on the jvmShootout! template engines on the jvm
Shootout! template engines on the jvm
 
Introduction to Node.js Platform
Introduction to Node.js PlatformIntroduction to Node.js Platform
Introduction to Node.js Platform
 
No Container: a Modern Java Stack with Bootique
No Container: a Modern Java Stack with BootiqueNo Container: a Modern Java Stack with Bootique
No Container: a Modern Java Stack with Bootique
 
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter LehtoJavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
 
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013
 
JavaCro'14 - Unit testing in AngularJS – Slaven Tomac
JavaCro'14 - Unit testing in AngularJS – Slaven TomacJavaCro'14 - Unit testing in AngularJS – Slaven Tomac
JavaCro'14 - Unit testing in AngularJS – Slaven Tomac
 
Byte code manipulation and instrumentalization in Java
Byte code manipulation and instrumentalization in JavaByte code manipulation and instrumentalization in Java
Byte code manipulation and instrumentalization in Java
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
 
Node Web Development 2nd Edition: Chapter1 About Node
Node Web Development 2nd Edition: Chapter1 About NodeNode Web Development 2nd Edition: Chapter1 About Node
Node Web Development 2nd Edition: Chapter1 About Node
 
Asp.net mvc 5 course module 1 overview
Asp.net mvc 5 course   module 1 overviewAsp.net mvc 5 course   module 1 overview
Asp.net mvc 5 course module 1 overview
 
Infinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORM
 
3rd Generation Web Application Platforms
3rd Generation Web Application Platforms3rd Generation Web Application Platforms
3rd Generation Web Application Platforms
 
Fun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJBFun with EJB 3.1 and Open EJB
Fun with EJB 3.1 and Open EJB
 
Microservices in Scala: Play Framework
Microservices in Scala: Play FrameworkMicroservices in Scala: Play Framework
Microservices in Scala: Play Framework
 
Building and Managing Projects with Maven
Building and Managing Projects with MavenBuilding and Managing Projects with Maven
Building and Managing Projects with Maven
 
Run-time of Node.js : V8 JavaScript Engine
Run-time of Node.js: V8 JavaScript EngineRun-time of Node.js: V8 JavaScript Engine
Run-time of Node.js : V8 JavaScript Engine
 
Alfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCFAlfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCF
 

Similar a Grails 4 and Micronaut at Devnexus 2019

Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019graemerocher
 
Level Up Your Integration Testing With Testcontainers
Level Up Your Integration Testing With TestcontainersLevel Up Your Integration Testing With Testcontainers
Level Up Your Integration Testing With TestcontainersVMware Tanzu
 
Java EE revisits design patterns
Java EE revisits design patternsJava EE revisits design patterns
Java EE revisits design patternsAlex Theedom
 
Java EE Revisits Design Patterns
Java EE Revisits Design PatternsJava EE Revisits Design Patterns
Java EE Revisits Design PatternsAlex Theedom
 
Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!Doris Chen
 
Java EE revisits design patterns
Java EE revisits design patterns Java EE revisits design patterns
Java EE revisits design patterns Alex Theedom
 
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...HostedbyConfluent
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersRob Windsor
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.WO Community
 
Struts2-Spring=Hibernate
Struts2-Spring=HibernateStruts2-Spring=Hibernate
Struts2-Spring=HibernateJay Shah
 
Mcknight well built extensions
Mcknight well built extensionsMcknight well built extensions
Mcknight well built extensionsRichard McKnight
 
Netflix oss season 2 episode 1 - meetup Lightning talks
Netflix oss   season 2 episode 1 - meetup Lightning talksNetflix oss   season 2 episode 1 - meetup Lightning talks
Netflix oss season 2 episode 1 - meetup Lightning talksRuslan Meshenberg
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Previewgraemerocher
 
Better End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorBetter End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorKasun Kodagoda
 
SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016Alex Theedom
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang YoonJesang Yoon
 
Java development with the dynamo framework
Java development with the dynamo frameworkJava development with the dynamo framework
Java development with the dynamo frameworkPatrick Deenen
 

Similar a Grails 4 and Micronaut at Devnexus 2019 (20)

Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019
 
Level Up Your Integration Testing With Testcontainers
Level Up Your Integration Testing With TestcontainersLevel Up Your Integration Testing With Testcontainers
Level Up Your Integration Testing With Testcontainers
 
Java EE revisits design patterns
Java EE revisits design patternsJava EE revisits design patterns
Java EE revisits design patterns
 
Java EE Revisits Design Patterns
Java EE Revisits Design PatternsJava EE Revisits Design Patterns
Java EE Revisits Design Patterns
 
Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!
 
Java EE revisits design patterns
Java EE revisits design patterns Java EE revisits design patterns
Java EE revisits design patterns
 
uMobile Development Strategies
uMobile Development StrategiesuMobile Development Strategies
uMobile Development Strategies
 
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
 
Struts2-Spring=Hibernate
Struts2-Spring=HibernateStruts2-Spring=Hibernate
Struts2-Spring=Hibernate
 
Mcknight well built extensions
Mcknight well built extensionsMcknight well built extensions
Mcknight well built extensions
 
Tangram
TangramTangram
Tangram
 
Netflix oss season 2 episode 1 - meetup Lightning talks
Netflix oss   season 2 episode 1 - meetup Lightning talksNetflix oss   season 2 episode 1 - meetup Lightning talks
Netflix oss season 2 episode 1 - meetup Lightning talks
 
JS Essence
JS EssenceJS Essence
JS Essence
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Preview
 
Better End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorBetter End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using Protractor
 
SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoon
 
Java development with the dynamo framework
Java development with the dynamo frameworkJava development with the dynamo framework
Java development with the dynamo framework
 

Último

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Último (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Grails 4 and Micronaut at Devnexus 2019

  • 1. GRAILS 4 AND MICRONAUT Getting the best out of Grails 4 and Micronaut
  • 2. About Me • Graeme Rocher • Creator of Grails and Micronaut • Principal Engineer at Object Computing • Oracle Groundbreaker Award Winner
  • 3. Agenda • Introduction to Micronaut • Introduction to Grails 4 • Grails vs Micronaut • Using Micronaut Features in Grails • Demos
  • 4. Micronaut for Grails Developers • Micronaut a Foundational Library for building applications of any type • Focuses on Small Memory Footprint and Speed • Eliminates Reflection, Runtime Proxies and Runtime Analysis
  • 5. Why Micronaut? • Micronaut is uses no reflection, no runtime proxies, no runtime byte code generation etc. • Eliminating these leads to reduced memory consumption and faster startup • Increasingly important for Microservices, Serverless, IoT, any low-memory footprint environment
  • 6. Micronaut vs Grails Micronaut Grails Range of Runtimes Servlet Only General Purpose Traditional Servlet Web Apps DI, AOP etc. Spring for DI, AOP etc. Java, Kotlin, Groovy, GraalVM Groovy Only Client and Server Server Only
  • 7. Grails 4 and Micronaut • Micronaut the Parent ApplicationContext • Made possible by • http://github.com/micronaut- projects/micronaut-spring • Micronaut Libraries become usable in Grails • Anything we build for Micronaut benefits Grails
  • 8. What Can/Should You Do • Build Configurations (Instead of Plugins) • Use Declarative Clients • HTTP • Kafka • RabbitMQ
  • 9. Configurations vs Plugins • Consider Building Configurations instead of Plugins • Work with Micronaut, Spring (with micronaut-spring) and Grails • Plugins only work with Grails • ... although some things only possible with Plugins (Views, taglibs etc.)
  • 11. Micronaut Configurations • Configuration with @ConfigurationProperties • Beans with @Singleton, @Factory etc. • Conditional Behaviour with @Requires • Customization with @Replaces
  • 12. @ConfigurationProperties Type Safe Configuration @ConfigurationProperties("example") class ExampleConfiguration { String name } ApplicationContext context = ApplicationContext.run("example.name":"Demo") FooConfiguration config = context.getBean(FooConfiguration) assert config.name == 'Demo'
  • 13. @Requires Conditional Beans Made Easy @Requires(property="example.enabled") @Requires(beans=DataSource) @Requires(missingBeans=Example) @Singleton class DefaultExampleBean implements Example { ... } def context = ApplicationContext.run("example.enabled":"true") Example example = context.getBean(Example)
  • 14. @Replaces Easily Replace Beans by Type @Replaces(DefaultExample) @Singleton class AlternativeExample implements Example { ... } • Types match much • Beans annotated with @Infrastructure not replaceable
  • 16. @Client Declarative Compile Time HTTP Clients @Client("https://api.github.com") @Header(name="User-Agent", value="micronaut-client") interface GithubClient { @Get("/repos/{+slug}") Info getInfo(String slug) } • Blocking or Non-Blocking (RxJava, Reactor or Future) • Reflection / Runtime Proxy Free
  • 17. @Client • Uses Micronaut's low-level HTTP client (RxHttpClient) under the hood • Built with Micronaut AOP (reflection/ runtime proxy free) • Works on GraalVM nativeimage • Integrates with Tracing, Metrics, Service Discovery etc.
  • 19. @KafkaClient Declarative Compile Time Kafka Clients @KafkaClient public interface ProductClient { @Topic("my-products") void sendProduct(@KafkaKey String brand, String name); } • Blocking or Non-Blocking (RxJava, Reactor or Future) https://github.com/micronaut-projects/micronaut-kafka
  • 20. @RabbitClient Declarative Compile Time Kafka Clients @RabbitClient("animals") interface AnimalClient { void send(@Header String animalType, Animal animal) } • Blocking or Non-Blocking (RxJava, Reactor or Future) https://github.com/micronaut-projects/micronaut-rabbitmq
  • 21. Micronaut Message Consumers • Micronaut Supports Message-Drive Microservices • Can be run as standalone processes (No HTTP server) • Use @RabbitListener for Rabbit • Use @KafkaListener for Kafka https://docs.micronaut.io/1.1.x/guide/ index.html#messaging
  • 22. Micronaut's Clients • Compile Time • Reflection and Runtime Proxy Free • Java, Groovy or Kotlin • Built with Micronaut AOP https://docs.micronaut.io/1.1.x/guide/ index.html#aop
  • 23. Summary • Micronaut Provides an Awesome Foundation • Building Blocks to Create Libraries, Configurations and Clients • Most Micronaut Features Available in Grails • Build Micronaut Libraries not Plugins
  • 24. Q & A