SlideShare a Scribd company logo
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

More Related Content

What's hot

Станислав Сидоренко «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 2
Smita B Kumar
 
Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSP
Gary 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 Platform
Naresh 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 Bootique
Andrus Adamchik
 
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
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
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
Sam Brannen
 
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
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
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
Alex Moskvin
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
Jeevesh Pandey
 
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
Rick 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 overview
Sergey Seletsky
 
Infinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORM
Infinum
 
3rd Generation Web Application Platforms
3rd Generation Web Application Platforms3rd Generation Web Application Platforms
3rd Generation Web Application Platforms
Naresh 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 EJB
Arun 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 Maven
Khan625
 
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
Gary Yeh
 
Alfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCFAlfresco WebScript Connector for Apache ManifoldCF
Alfresco WebScript Connector for Apache ManifoldCF
Piergiorgio Lucidi
 

What's hot (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 to 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 2019
graemerocher
 
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
VMware Tanzu
 
Java EE revisits design patterns
Java EE revisits design patternsJava EE revisits design patterns
Java EE revisits design patterns
Alex Theedom
 
Java EE Revisits Design Patterns
Java EE Revisits Design PatternsJava EE Revisits Design Patterns
Java EE Revisits Design Patterns
Alex 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
 
uMobile Development Strategies
uMobile Development StrategiesuMobile Development Strategies
uMobile Development Strategies
Jasig uPortal Project
 
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 Developers
Rob 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=Hibernate
Jay Shah
 
Mcknight well built extensions
Mcknight well built extensionsMcknight well built extensions
Mcknight well built extensions
Richard McKnight
 
Tangram
TangramTangram
Tangram
Yubei Li
 
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 Preview
graemerocher
 
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
Kasun 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 2016
Alex 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 Yoon
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
Patrick Deenen
 

Similar to 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
 

Recently uploaded

First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 

Recently uploaded (20)

First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 

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