3 hour deep dive presentation by Micronaut creator, Graeme Rocher, at Devoxx Belgium 2019 showing how to use advanced features such as Aspect Oriented Programming (AOP), compiler plugins and so on. Associated YouTube video can be found at https://www.youtube.com/watch?v=S5yfTfPeue8
Micronaut: Evolving Java for the Microservices and Serverless Eragraemerocher
Presentation by Micronaut creator Graeme Rocher on how frameworks like Micronaut are evolving Java for the Microservice and Serverless Era through the use of innovative techniques like Ahead of Time Compilation (AoT)
Presentation given at Devnexus 2019 on Micronaut Internals by Micronaut creator Graeme Rocher including information how how Dependency Injection and Aspect Oriented Programming work in Micronaut.
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019graemerocher
Presentation by Micronaut creator of the Ahead of Time (AOT) compilation features in Micronaut given at Devnexus 2019 including a demo on how to use AOT to generate Avro schemas for Kafka.
Example code can be found at https://github.com/micronaut-projects/presentations/tree/master/demos/devnexus2019/aotdemos
Spring cloud for microservices architectureIgor Khotin
I'm covering a new trend in distributed enterprise architecture – microservices. How the leading technology companies like Netflix and Amazon come to use that approach. How does it help them to scale their infrastructure. And how the newest set of tools in the Spring family would help you to apply those design principles in practice.
Spring has always been about patterns and Spring Cloud brings you implementation of several widespread ones for distributed apps.
And we'll try to show why DevOps should come in front of Microservices approach
Micronaut: Evolving Java for the Microservices and Serverless Eragraemerocher
Presentation by Micronaut creator Graeme Rocher on how frameworks like Micronaut are evolving Java for the Microservice and Serverless Era through the use of innovative techniques like Ahead of Time Compilation (AoT)
Presentation given at Devnexus 2019 on Micronaut Internals by Micronaut creator Graeme Rocher including information how how Dependency Injection and Aspect Oriented Programming work in Micronaut.
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019graemerocher
Presentation by Micronaut creator of the Ahead of Time (AOT) compilation features in Micronaut given at Devnexus 2019 including a demo on how to use AOT to generate Avro schemas for Kafka.
Example code can be found at https://github.com/micronaut-projects/presentations/tree/master/demos/devnexus2019/aotdemos
Spring cloud for microservices architectureIgor Khotin
I'm covering a new trend in distributed enterprise architecture – microservices. How the leading technology companies like Netflix and Amazon come to use that approach. How does it help them to scale their infrastructure. And how the newest set of tools in the Spring family would help you to apply those design principles in practice.
Spring has always been about patterns and Spring Cloud brings you implementation of several widespread ones for distributed apps.
And we'll try to show why DevOps should come in front of Microservices approach
Effective cloud-ready apps with MicroProfilePayara
Presented during Payara Japan Tour 2019 (https://blog.payara.fish/payara-on-tour-in-japan).
In this session, you'll learn how to develop applications that evolve according to your needs, can easily run in the cloud and integrate with common cloud technologies. We'll start with a simple application, focusing on business logic. MicroProfile framework, powered by a lightweight opensource Payara Micro runtime, will get us started quickly and allow gradual improvements later.
MicroProfile contains a lot of components that make developers productive. It allows separating business logic from common concerns like configuration, failure-recovery, REST service calls, context propagation across service calls and securing services. Adding all of these to existing code is easy. It's also easy to introduce new microservices as needed and adopt cloud technologies as your application grows. I'll show you how, in a step-by-step demo. And if time allows, I'll also show how to run and scale your application effectively with Kubernetes in the cloud.
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entityToni Jara
The presentation explains the journey from a monolithic architecture to Spring Cloud Microservices for application development inside a financial entity, along with the transition to DevOps strategies… a journey that has just begun…
Deploying Elastic Java EE Microservices in the Cloud with DockerPayara
JavaOne 2015 tutorial describing how to build and deploy a micro services to Amazon Elastic Beanstalk with Docker and Payara Micro. All code is on GitHub
Microservices architecture has many benefits. But it comes at a cost. Running microservices and monitoring what’s going on is tedious. That’s why MicroProfile adopts monitoring as a first-class concept. In this session, learn how MicroProfile runtimes collect metrics and how to seamlessly collect them with tools like Prometheus and Grafana. Learn how MicroProfile makes it easy to connect information about interrelated service calls, how to gather the information and analyze system bottlenecks, how to deploy and scale MicroProfile applications with Kubernetes and how to react to their health status to detect and automatically recover from failures.
Microservices - java ee vs spring boot and spring cloudBen Wilcock
A short presentation on the clear differences in approach between the top two Java frameworks for microservices, service orientation and web-service development - Java EE (JEE) and Spring (Spring Boot and Spring Cloud).
With the rise of micro-services, REST communication is more popular than ever. But the communication between the different parts must also be performed in a secure way.
First, we need to know if the user or system is allowed to call the JAX-RS endpoint. For this authentication part, self-contained tokens are the best option to not overload any of our services in the system. JWT which contains the authentication but also can contain the authorization info is ideal for this use-case.
And secondly, we need guarantees that the message isn't altered, that we can have message integrity. For that part, we can use signatures as specified in the HTTP signature draft specification.
Check out the talk to the slides:
http://bit.ly/1ReY8uJ
Talk Abstract:
Using Swarm, you can select “just enough app server” to support each of your microservices.
In this session, we’ll outline how WildFly Swarm works and get you started writing your first microservices using Java EE technologies you’re already familiar with.
You’ll learn how to setup your build system (Maven, Gradle, or your IDE of choice) to run and test WildFly Swarm-based services and produce runnable jars. We will walk from the simple case of wrapping a normal WAR application to the more advanced case of configuring the container using your own main(…) method.
The goal of MicroProfile is to optimise Java EE for a micro-service architecture. It is based on some of the Java EE specifications and standardise a few technologies from the micro-services space.
However, some of the MicroProfile implementations are completely different 'servers', like the KumuluzEE server. So how can you migrate easily from your favorite Java EE server to a MicroProfile implementation?
This session shows you an overview of what MicroProfile.IO is and how it relates to Java EE. It then demonstrates with a few examples how you can adjust your Java EE application to incorporate some of the MicroProfile.IO specifications and how you can transform your Java EE application to a MicroProfile.IO one using Thorntail, Payara Micro, and KumuluzEE.
Effective cloud-ready apps with MicroProfilePayara
Presented during Payara Japan Tour 2019 (https://blog.payara.fish/payara-on-tour-in-japan).
In this session, you'll learn how to develop applications that evolve according to your needs, can easily run in the cloud and integrate with common cloud technologies. We'll start with a simple application, focusing on business logic. MicroProfile framework, powered by a lightweight opensource Payara Micro runtime, will get us started quickly and allow gradual improvements later.
MicroProfile contains a lot of components that make developers productive. It allows separating business logic from common concerns like configuration, failure-recovery, REST service calls, context propagation across service calls and securing services. Adding all of these to existing code is easy. It's also easy to introduce new microservices as needed and adopt cloud technologies as your application grows. I'll show you how, in a step-by-step demo. And if time allows, I'll also show how to run and scale your application effectively with Kubernetes in the cloud.
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entityToni Jara
The presentation explains the journey from a monolithic architecture to Spring Cloud Microservices for application development inside a financial entity, along with the transition to DevOps strategies… a journey that has just begun…
Deploying Elastic Java EE Microservices in the Cloud with DockerPayara
JavaOne 2015 tutorial describing how to build and deploy a micro services to Amazon Elastic Beanstalk with Docker and Payara Micro. All code is on GitHub
Microservices architecture has many benefits. But it comes at a cost. Running microservices and monitoring what’s going on is tedious. That’s why MicroProfile adopts monitoring as a first-class concept. In this session, learn how MicroProfile runtimes collect metrics and how to seamlessly collect them with tools like Prometheus and Grafana. Learn how MicroProfile makes it easy to connect information about interrelated service calls, how to gather the information and analyze system bottlenecks, how to deploy and scale MicroProfile applications with Kubernetes and how to react to their health status to detect and automatically recover from failures.
Microservices - java ee vs spring boot and spring cloudBen Wilcock
A short presentation on the clear differences in approach between the top two Java frameworks for microservices, service orientation and web-service development - Java EE (JEE) and Spring (Spring Boot and Spring Cloud).
With the rise of micro-services, REST communication is more popular than ever. But the communication between the different parts must also be performed in a secure way.
First, we need to know if the user or system is allowed to call the JAX-RS endpoint. For this authentication part, self-contained tokens are the best option to not overload any of our services in the system. JWT which contains the authentication but also can contain the authorization info is ideal for this use-case.
And secondly, we need guarantees that the message isn't altered, that we can have message integrity. For that part, we can use signatures as specified in the HTTP signature draft specification.
Check out the talk to the slides:
http://bit.ly/1ReY8uJ
Talk Abstract:
Using Swarm, you can select “just enough app server” to support each of your microservices.
In this session, we’ll outline how WildFly Swarm works and get you started writing your first microservices using Java EE technologies you’re already familiar with.
You’ll learn how to setup your build system (Maven, Gradle, or your IDE of choice) to run and test WildFly Swarm-based services and produce runnable jars. We will walk from the simple case of wrapping a normal WAR application to the more advanced case of configuring the container using your own main(…) method.
The goal of MicroProfile is to optimise Java EE for a micro-service architecture. It is based on some of the Java EE specifications and standardise a few technologies from the micro-services space.
However, some of the MicroProfile implementations are completely different 'servers', like the KumuluzEE server. So how can you migrate easily from your favorite Java EE server to a MicroProfile implementation?
This session shows you an overview of what MicroProfile.IO is and how it relates to Java EE. It then demonstrates with a few examples how you can adjust your Java EE application to incorporate some of the MicroProfile.IO specifications and how you can transform your Java EE application to a MicroProfile.IO one using Thorntail, Payara Micro, and KumuluzEE.
Byte code manipulation and instrumentalization in JavaAlex Moskvin
In presentation we consider - what bytecode is, how to manipulate it, how does it look like, how to read it and why would anyone needs to manipulate it.
We also develop a java agent that instrumentalizes access to MongoDB Java driver and expose that metrics via JMX.
Overview of Java EE 6 by Roberto Chinnici at SFJUGMarakana Inc.
Roberto Chinnici, Java EE 6 spec lead, gives an overview of Java EE 6 for San Francisco Java User Group on August 10th, 2010.
http://www.sfjava.org/calendar/13940755/
Containers are an amazing technology that are revolutionising how we deploy and create applications. Docker and Kubernetes are helping developers and organisations realise the magical potential that container technology and orchestration offer. Enter MicroShed and the Testcontainers framework enabling local test automation that leverages that magical portability containers offer. In this session we'll explore how Testcontainers can help you run and test with true-to-production environments in development with minimal re-writing of your test code.
JLove - Replicating production on your laptop using the magic of containersGrace Jansen
Containers are an amazing technology that are revolutionising how we deploy and create applications. Docker and Kubernetes are helping developers and organisations realise the magical potential that container technology and orchestration offer. Enter MicroShed and the Testcontainers framework enabling local test automation that leverages that magical portability containers offer. In this session we'll explore how Testcontainers can help you run and test with true-to-production environments in development with minimal re-writing of your test code.
In this Java Hibernate Training session, you will learn Integrating Struts with Hibernate. Topics covered in this session are:
• Struts 2
• Struts Action Class
• Validation
• Control Tags
• Data Tags
For more information, visit this link:
https://www.mindsmapped.com/courses/software-development/learn-hibernate-fundamentals-from-scratch/
Did you know your JDK contains visual monitoring tools with features like: Profiler, Visual GC, Heap dump browsing and much more?
VisualVM, BTrace and jhat are just some examples for useful performance diagnostics tools hidden in your JDK.
Join us for this session to see what tools are out there and how you can use them to identify and solve performance related issues.
In this session you will learn:
1. Introduction to Struts Framework
2. Features
3. Evolution
4. Struts Demo
5. Declarative validation
6. Architecture
7. Validators
8. Interceptors
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
2. About Me
• Graeme Rocher
• Creator of Grails and Micronaut
• Principal Engineer at Object Computing
• 2018 Oracle Groundbreaker Award Winner
• Java Champion
3. Agenda
Part 1 - 45 Minutes
• Introduction to Micronaut
• Why Micronaut
• Micronaut Fundamentals
• Micronaut Test
• Bean Introspection
• Dependency Injection
• Configuration Management
4. Agenda
Part 2 - 45 Minutes
• Micronaut AOP
• Bean Validation
• Bean Events and Listeners
• Followed by a 10 Minute Break
5. Agenda
Part 3 - 45 Minutes
• Micronaut HTTP Server
• Micronaut HTTP Client
• Swagger / OpenAPI
6. Agenda
Part 4 - 35 Minutes
• Introducing Micronaut Data
• Micronaut Data JPA
• Micronaut Data JDBC
• Micronaut & GraalVM Native Image
7. Part 1 - 45 Minutes
• Introduction to Micronaut
• Why Micronaut
• Micronaut Fundamentals
• Micronaut Test
• Bean Introspection
• Dependency Injection
• Configuration Management
8. Java's Problems for
Frameworks
• Limited Annotation API
• Type Erasure
• Slow Reflection
• Reflective Data Caches
• Classpath Scanning
• Slow Dynamic Class Loading
9.
10.
11. The Micro Reality
• Frameworks based on reflection
and annotations become fat
• But we love the programming
model and productivity so
we live with it
• Why can't we be
more efficient?
12. Java's Problems
• Greatly Exaggerated (Java has been
dead forever)
• Java can be Fast! (see Android and
Micronaut)
• However Most Existing Tools are
based around
• Reflection
• Runtime Proxies
• Runtime Byte Code Generation
(bytebuddy/cglib)
13. Why is Reflection a Problem?
• Today the JDK is OpenJDK!
• Just take a look...
http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/
share/classes/java/lang/Class.java#l2471
• All Reflective data initialized on first access and held in soft
references (yes every field, method etc.)
• Won't be GC'ed until your application is low on memory!
14. Avoid Reflection!
• Reflection usage increases memory
usage
• Using reflection relatively slow
• Problem is most modern server-side
frameworks and specifications
are built on reflection
• Some of the Jarkarta specifications
even mandate reflection
15. Just Like The
Android World
• The Android Community already
solved the problem
• Ahead of Time Compilation used
extensively
• Google Dagger 2.x for DI
• Most Android Frameworks avoid
reflection to
avoid paying the memory /
performance cost
16.
17. Micronaut
• A Microservices and Serverless
Focused framework (hence the
branding)
• Also a Complete Application
Framework for any type of
Application
• Dependency Injection, Aspect
Oriented Programming (AOP),
Configuration Management,
Bean Introspection and more..
18. With Micronaut You
Can Build
• Microservices
• Serverless Applications
• Message-Driven Applications with
Kafka/Rabbit
• CLI Applications
• Even Android Applications
• Anything with
static void main(String..args)
19. Micronaut History
• Development Started over 2 years
ago
• Open Sourced May 2018
• Creating waves ever since
• Inspired other frameworks to
improve
and new frameworks to be born
based on the same approach
20. Micronaut Current
Status
• Micronaut 1.2.5 current stable
release
• Built by the people that built Grails
• Nearly 3K Github Stars
• Used in production and delivering
real
savings in cloud spend to dozens of
organizations already
21.
22. Micronaut's Solutions
Problem Solution
Limited Annotation API Precomputed AnnotationMetadata
Type Erasure Precomputed Argument Interface
Slow Reflection Eliminate Reflection
Reflective Data Caches Zero Data Caches
Classpath Scanning No Classpath Scanning
Slow Dynamic Class Loading No Dynamic Class Loaders
25. Project Setup
• The Quick Way with SDKMan! (https://sdkman.io/):
$ sdk install micronaut
## For Maven
$ mn create-app example --build maven
## For Gradle
$ mn create-app example --build gradle
• Can setup manually. CLI is just a handy helper
26. Micronaut Minimum Setup
• A Micronaut project is just a Java project with an additional
annotation processor
annotationProcessor "io.micronaut:micronaut-inject-java:1.2.5" // Gradle
<annotationProcessorPaths> <!-- Maven -->
<path>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-inject-java</artifactId>
<version>1.2.5</version>
</path>
...
27.
28. Micronaut Test
• Testing library with support for Spock and JUnit 5
https://github.com/micronaut-projects/micronaut-test
testCompile "io.micronaut.test:micronaut-test-junit5" // Gradle
<dependency> <!-- Maven -->
<groupId>io.micronaut.test</groupId>
<artifactId>micronaut-test-junit5</artifactId>
<scope>test</scope>
</dependency>
...
29. Micronaut Test
• Allows DI directly into your tests
• Spins up server if present
@MicronautTest
class MathServiceTest {
@Inject
MathService mathService;
@Test
void testCompute() {
final Integer result = mathService.compute(4);
Assertions.assertEquals(16,result);
}
}
33. AnnotationMetadata
AnnotationMetadata metadata = BeanIntrospection.getIntrospection(MyBean.class)
.getAnnotationMetadata();
if (metadata.hasStereotype(SomeAnnotation.class)) {
// do stuff
}
• AOT Computed / Merged Annotation Replacement for
Reflection based API
• Includes knowledge of meta-annotations
34. AnnotationMapper
• Map the value of one annotation to another at compilation
time
class KotlinNullableMapper implements NamedAnnotationMapper {
public String getName() {
return "org.jetbrains.annotations.Nullable";
}
public List<AnnotationValue<?>> map(
AnnotationValue<Annotation> annotation,
VisitorContext visitorContext) {
return Collections.singletonList(
AnnotationValue.builder("javax.annotation.Nullable").build()
);
}
}
39. Micronaut DI
@Inject MyBean myBean;
@Named("someOther") MyBean someOther;
• Supports and passes the javax.inject TCK
• Supports @PostContruct / @PreDestroy
• Completely reflection free and fast
• Constructor injection encouraged
40. ApplicationContext
try (ApplicationContext ctx = ApplicationContext.run()) {
MyBean myBean = ctx.getBean(MyBean.class);
}
• Entry point for running Micronaut applications
• Can be customized with ApplicationContext.build()
• Implements AutoCloseable for easy shutdown / running
bean destruction hooks
41. BeanDefinition
ApplicationContext ctx = ApplicationContext.run();
BeanDefinition<MyBean> definition
= ctx.getBeanDefinition(MyBean.class);
• Contains precomputed AnnotationMetadata and generic
type info
• Used by ApplicationContext to instantiate beans
42. BeanDefinition
• Bean definitions produced for any @Singleton
• Constructor injection used by default
• Use @Factory for beans you cannot annotate
• Compliant with javax.inject spec and TCK
45. @Requires
Conditional Beans Made Easy
@Requires(property="example.enabled")
@Requires(beans=DataSource.class)
@Requires(missingBeans=Example.class)
@Singleton
class DefaultExampleBean implements Example {
...
}
ApplicationContext context = ApplicationContext.run("example.enabled":"true")
Example example = context.getBean(Example)
47. Micronaut AOP
• Designed to be reflection free
• No runtime generated proxies or
byte code generation
• Fast and efficient thanks to smaller
stack traces
• Allow for all the typical framework
use cases:
@Transactional, @Cacheable,
@Validated etc.
48. @Executable
@Executable
void someMethod() {
...
}
• Replacement for java.lang.reflect.Method
• Only generate method handles where needed
return beanDefinition.getRequiredMethod("someMethod")
.invoke(someBean);
49. @ExecutableMethodProcessor
public class ScheduledMethodProcessor
implements ExecutableMethodProcessor<Scheduled> {
public void process(BeanDefinition<?> beanDefinition,
ExecutableMethod<?, ?> method) {
// do stuff with the bean
}
}
• Processes only methods annotated by the given type
argument
• In the above case setting up a scheduled job
50. Micronaut AOP
Annotation Stereotypes
• @Around - Allows decorating a method by surrounding it
with new behaviour (caching, transactions etc.)
• @Introduction - Allows introducing new behaviour to
existing classes and interfaces
• @Adapter - Allows adapting a method to a Single Abstract
Method (SAM) type.
52. @Around
@Retryable // @Retryable is annotated with @Around
void invokeMe() {
// do stuff
}
• Intercepts a method with a MethodInterceptor
• No runtime proxies (compile time proxies) or reflection
needed
• No FancyProxyFactoryBean or containers needed!
58. @Adapter
@Singleton
public class Application {
@EventListener
void init(StartupEvent event) {
// on startup do something
}
}
• @EventListener is a great example of adapter advice
61. Micronaut
Validation
• Support for javax.vallidation
annotations
• Partial implementation of spec
without the parts that require
reflection
• Reuses Bean Introspections to save
memory
63. Other Advice Types
• @Cacheable - cache operations (support for Redis, in-
memory etc.)
• @Transactional - use standard javax.transactional,
Spring's or which you want
• @Retryable - Built in retry support
• @CircuitBreaker - Circuit breaker pattern
• @Async - Makes events execute asynchronously
66. Micronaut Runtimes
Dependency Runtime
micronaut-http-server-netty Default Netty Server
micronaut-kafka Kafka Headless Server
micronaut-picocli PicoCLI command line app
micronaut-grpc GRPC Server
micronaut-graphql GraphQL Server
micronaut-ktor Kotlin KTOR Framework support
micronaut-function-aws-api-proxy AWS Lambda
67. Micronaut HTTP
Server
• Default Netty-based Reactive Server
• Support for both blocking and non-
blocking I/O
• Choose your reactive framework:
RxJava2, Reactor etc.
• Any annotation model: Micronaut,
Spring, JAX-RS (coming soon)
• Integrated Jackson with reflection-
free extensions
69. EmbeddedServer
try( EmbeddedServer embeddedServer
= ApplicationContext.run(EmbeddedServer.class) ) {
System.out.println(embeddedServer.getPort());
}
• The EmbeddedServer interface allows easily spinning up the
server
programmatically or in tests.
70. Controller Hello World
import io.micronaut.http.MediaType;
import io.micronaut.http.annotation.*;
@Controller("/hello")
public class HelloController {
@Get(produces = MediaType.TEXT_PLAIN)
public String index() {
return "Hello World";
}
}
• Use annotations in the io.micronaut.http.annotation
package
72. Micronaut HTTP
Client
• Netty-Based HTTP Client
• Low-level API and declarative
compile-time client
• Uses @Introduction advice to
simplify writing clients
• Reactive, CompletableFuture and
blocking support
• Built in Service Discovery support
73. Client Hello World
import io.micronaut.http.MediaType;
import io.micronaut.http.annotation.*;
@Client("/hello")
public interface HelloClient {
@Get(produces = MediaType.TEXT_PLAIN)
public String hello();
}
• Use annotations in the io.micronaut.http.annotation
package
74. Micronaut HTTP
Filters
• Filters can apply to server and/or
client
• Allow altering request/response
before proceeding
• Useful for adding headers,
authentication, tracing,
token propagation etc.
75. Micronaut Service
Discovery
• Support for Consul, Kubernetes and
Eureka
• Configuration Support for Consul,
Kubernetes, Vault,
Spring Cloud Config Server and
AWS ParameterStore
• Native Client Side Load Balancing
• Tracing with Zipkin or Jaeger
76. Micronaut Management
• Simply add micronaut-management
Endpoint Description
/info Basic information about the app
/health Health Check support
/loggers View and Mutate log config
/metrics Metrics with Micrometer
/env Resolved configuration
/refresh Refresh the app state
/routes View active routes
79. Micronaut OpenAPI
• Produces swagger.yml at
compilation time
• Easy to expose this static file to
Swagger UI.
• Doing the work at compilation time
== less memory consumption
• Uses Micronaut
TypeElementVisitor API
80. Part 4 - 35 Minutes
• Introducing Micronaut Data
• Micronaut Data JPA
• Micronaut Data JDBC
• Micronaut & GraalVM Native Image
81. Existing Data
Access Solutions
• Spring Data, GORM etc.
• Rely heavily on reflection and
runtime proxies
• Must compute queries at runtime
• Cost of computation grows as your
application grows
82. Micronaut Data
• Precomputes Queries at compilation
time
• Uses Micronaut's reflection-free AOP
• Zero runtime overhead database
access solution
• Compilation time checking
• Smaller stack traces
• JPA-QL and SQL currently supported
83. Hello Micronaut Data
• Each repository interface annotated with @JdbcRepository
• Can extend built in interfaces like CrudRepository
@JdbcRepository(dialect=Dialect.MYSQL)
interface PersonRepository
extends CrudRepository<Person,Long> {
Person findByName(String name);
}
84. CRUD Example
// Create
personRepository.save(new Person("Fred"));
// Read
Person person = personRepository.findByName("Fred");
// Update
person.updatePerson(person.getId(), "Bob");
// deleteById
person.deleteById(person.getId());
86. Micronaut and
GraalVM
• A New Universal Virtual Machine
from Oracle
• Features a native-image Tool
• Converts Java -> native machine
code using AOT
• Works well with Micronaut
• Startup time 20ms and Memory
Consumption 18MB!
http://www.graalvm.org
87. Micronaut and
GraalVM
• GraalVM is cool and a project to
keep an eye on
• Still in beta and experimental
• Micronaut optimizes for GraalVM,
but
also optimizes for regular Java (what
most people use today)
http://www.graalvm.org
91. Summary
• Micronaut Provides an Awesome Set of Framework
Primitives
• Sacrifices Compilation Speed to Gain so Much More
• Solves Problems with Spring, Jakarta EE and Java in General
• Opens the Door to GraalVM Native