SlideShare a Scribd company logo
Reactive Microservices with Java and
Java EE
Rodrigo Cândido da Silva @rcandidosilva
Israel Boza Rodriguez @IsraKaos
Agenda
• Monolithic vs. Microservices
• Reactive Manifesto
• Resilience
• Message-driven
• Demo
• Q&A
Monolithic vs. Microservices
Microservices
• Small components
• Isolated deployment
• Independent technology
• Separate infrastructure
"Small independent component with well-
defined boundaries that’s doing one thing, but
doing it well"
Reactive Manifesto
Resilient
• How to support it on microservices?
• Central point of configuration
• Service registry and discovery
• Routing features
• Load balancing
• Failover
• Monitoring
Spring BootSpring Cloud
Spring Cloud + Netflix OSS
Spring Cloud + Netflix OSS
“Nice match to build resilient microservices with
Java"
Configuration Management Spring Cloud Config + Bus
Service Registration and Discovery Netflix Eureka
Load Balacing Netflix Ribbon
Circuit Breaker Netflix Hystrix + Turbine
Proxy Server Netflix Zuul
Autenthication Spring Cloud Security
Spring Cloud Config
Netflix Eureka
Netflix Ribbon
Netflix Hystrix
• Circuit Breaker Pattern
Hystrix Dashboard
Netflix Zuul
Spring Cloud Security
Discovery	
Client
Relying Party
Resource
Server
Get an access token
& an ID Token (JWT)
Use an access token
Authorization
Server
Iden.ty	Provider	or	
IDP	or		
OpenID	Provider	or	
OP	
	
	
Authorization
Endpoint
Token
Endpoint
Important Stuff
Userinfo
Endpoint
Registration
Endpoint
JWKS
Endpoint
JWKS
Endpoint
Validate
(JWT)
ID Token
/.well-known	
/webfinger	
/openid-configura.on
Check Session IFrame
End Session Endpoint
Message-Driven
• How to support it on microservices?
• Asynchronous communication
• Non blocking I/O
• Distributed
• Consistency
• Event sourcing
• CQRS
Reactive Programming
• Asynchronous communication and data streams
• reactive-streams.org
Reactive Alternatives at Java EE
JMS EJB 3
Message-Driven
Beans
Asynchronous
Session Beans
CDI
Events
Observers
Servlet
Asynchronous
NIO
JAX-RS
Async on Server
Async on Client
WebSocket
Async Remote
Endpoints
Concurrency
Utilities
Project Reactor
• Library for building non-blocking apps
• Interacts with Java 8 functional API
• Offers two reactive composable API
• Flux[N] and Mono[0|1]
• Supports scalable in-memory routing with Bus
extensions
• Ported to support microservices
REST Endpoint
@RestController
public class UserRestController {
private static final List<User> users = new ArrayList<>();
static {
users.add(new User(1, "Rodrigo", "C", "da Silva"));
users.add(new User(2, "Israel", "B", "Rodriguez"));
users.add(new User(3, "Bruno", "", "Souza"));
users.add(new User(4, "Edson", "", "Yanaga"));
}
@RequestMapping(method = RequestMethod.GET, value = "/users")
public List<User> getUsers() {
return users;
}
@RequestMapping(method = RequestMethod.GET, value = "/user/{id}")
public User getUser(@PathVariable("id") Integer id) {
return users.stream().filter(g -> g.getId() == id)
.collect(Collectors.toList()).get(0);
}
}
REST Proxy
@Component
public class UserServiceProxy {
@Autowired UserService service;
@HystrixCommand(fallbackMethod = "defaultUsersObservable")
public Observable<List<User>> getUsersObservable() {
return new ObservableResult<List<User>>() {
@Override
public List<User> invoke() {
return service.getUsers();
}
};
}
public Observable<User> defaultUsersObservable() {
return null;
}
} @FeignClient("USER-SERVICE")
public interface UserService {
@RequestMapping(value = "/users", method = RequestMethod.GET)
List<User> getUsers();
@RequestMapping(value = "/user/{id}", method = RequestMethod.GET)
User getUser(@PathVariable("id") Integer id);
}
REST Async Client
@RestController
public class APIController {
@Autowired
GroupServiceProxy groupService;
@Autowired
UserServiceProxy userService;
@RequestMapping(method = RequestMethod.GET, value = "/userGroups")
public UserGroup getUserGroups() {
Observable<List<Group>> groups = groupService.getGroupsObservable();
Observable<List<User>> users = userService.getUsersObservable();
Observable<UserGroup> userGroupObservable =
Observable.zip(groups, users, (g, u) -> new UserGroup(u, g));
return userGroupObservable.toList().toBlocking().single().get(0);
}
}
Demo
• Reactive Microservices
• https://github.com/rcandidosilva/reactive-microservices
Other Alternatives
Q&A
?
References
• http://projects.spring.io/spring-boot/
• http://projects.spring.io/spring-cloud/
• https://netflix.github.io/
• http://www.reactive-streams.org/
• http://www.reactivemanifesto.org/
• https://github.com/reactivemanifesto/website-manifesto/tree/master/public/pdf
• https://projectreactor.io/
• http://reactivex.io/
• http://www.kennybastani.com/2016/04/event-sourcing-microservices-spring-
cloud.html
Thank you!
Obrigado!
Ad

Recommended

PDF
GUJavaSC - Criando Micro-serviços Reativos com Java
Rodrigo Cândido da Silva
 
PDF
Building Services with WSO2 Microservices framework for Java and WSO2 AS
Kasun Gajasinghe
 
PPTX
Microservices with Node.js and Apache Cassandra
Jorge Bay Gondra
 
PDF
JavaCro'15 - Service Discovery in OSGi Beyond the JVM using Docker and Consul...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Lagom in Practice
JWORKS powered by Ordina
 
PDF
WSO2 Enterprise Service Bus - Product Overview
WSO2
 
PDF
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
Kasun Gajasinghe
 
PPTX
Micro service architecture
uEngine Solutions
 
PDF
Developing Micro-Services for Cloud using Java
WSO2
 
PDF
Microservices with Spring Cloud
Daniel Eichten
 
PPTX
WSO2 Workshop Sydney 2016 - Microservices
Dassana Wijesekara
 
PDF
Webinar: Message Tracing and Debugging in WSO2 Enterprise Service Bus
WSO2
 
PDF
User authentication and authorizarion in Kubernetes
Neependra Khare
 
PDF
MicroProfile Panel - Sept 2016
Ray Ploski
 
PDF
Understanding MicroSERVICE Architecture with Java & Spring Boot
Kashif Ali Siddiqui
 
PPTX
Bluemix paas 기반 saas 개발 사례
uEngine Solutions
 
PPTX
Introduction to WSO2 Microservices Framework for Java - MSF4J - WSO2Con Asia ...
Afkham Azeez
 
PDF
Securing Microservices using Play and Akka HTTP
Rafal Gancarz
 
PDF
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Introduction to the Nancy Framework
Tim Bourguignon
 
PDF
Refactor your Java EE application using Microservices and Containers - Arun G...
Codemotion
 
PDF
Introduction to the All New WSO2 Governance Centre
Sagara Gunathunga
 
PPTX
Node.js Blockchain Implementation
GlobalLogic Ukraine
 
PDF
APIs: Intelligent Routing, Security, & Management
NGINX, Inc.
 
PDF
CQRS and ES with Lagom
Miel Donkers
 
PDF
Microservices with Java, Spring Boot and Spring Cloud
Eberhard Wolff
 
PDF
JAX-RS 2.1 Reloaded @ Devoxx
Santiago Pericas-Geertsen
 
PPTX
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
Javier García Magna
 
PDF
JavaOne LATAM 2016 - Combinando AngularJS com Java EE
Rodrigo Cândido da Silva
 
PDF
QCon SP 2016 - Construindo Microservices Auto-curáveis com Spring Cloud e Net...
Rodrigo Cândido da Silva
 

More Related Content

What's hot (20)

PDF
Developing Micro-Services for Cloud using Java
WSO2
 
PDF
Microservices with Spring Cloud
Daniel Eichten
 
PPTX
WSO2 Workshop Sydney 2016 - Microservices
Dassana Wijesekara
 
PDF
Webinar: Message Tracing and Debugging in WSO2 Enterprise Service Bus
WSO2
 
PDF
User authentication and authorizarion in Kubernetes
Neependra Khare
 
PDF
MicroProfile Panel - Sept 2016
Ray Ploski
 
PDF
Understanding MicroSERVICE Architecture with Java & Spring Boot
Kashif Ali Siddiqui
 
PPTX
Bluemix paas 기반 saas 개발 사례
uEngine Solutions
 
PPTX
Introduction to WSO2 Microservices Framework for Java - MSF4J - WSO2Con Asia ...
Afkham Azeez
 
PDF
Securing Microservices using Play and Akka HTTP
Rafal Gancarz
 
PDF
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Introduction to the Nancy Framework
Tim Bourguignon
 
PDF
Refactor your Java EE application using Microservices and Containers - Arun G...
Codemotion
 
PDF
Introduction to the All New WSO2 Governance Centre
Sagara Gunathunga
 
PPTX
Node.js Blockchain Implementation
GlobalLogic Ukraine
 
PDF
APIs: Intelligent Routing, Security, & Management
NGINX, Inc.
 
PDF
CQRS and ES with Lagom
Miel Donkers
 
PDF
Microservices with Java, Spring Boot and Spring Cloud
Eberhard Wolff
 
PDF
JAX-RS 2.1 Reloaded @ Devoxx
Santiago Pericas-Geertsen
 
PPTX
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
Javier García Magna
 
Developing Micro-Services for Cloud using Java
WSO2
 
Microservices with Spring Cloud
Daniel Eichten
 
WSO2 Workshop Sydney 2016 - Microservices
Dassana Wijesekara
 
Webinar: Message Tracing and Debugging in WSO2 Enterprise Service Bus
WSO2
 
User authentication and authorizarion in Kubernetes
Neependra Khare
 
MicroProfile Panel - Sept 2016
Ray Ploski
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Kashif Ali Siddiqui
 
Bluemix paas 기반 saas 개발 사례
uEngine Solutions
 
Introduction to WSO2 Microservices Framework for Java - MSF4J - WSO2Con Asia ...
Afkham Azeez
 
Securing Microservices using Play and Akka HTTP
Rafal Gancarz
 
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Introduction to the Nancy Framework
Tim Bourguignon
 
Refactor your Java EE application using Microservices and Containers - Arun G...
Codemotion
 
Introduction to the All New WSO2 Governance Centre
Sagara Gunathunga
 
Node.js Blockchain Implementation
GlobalLogic Ukraine
 
APIs: Intelligent Routing, Security, & Management
NGINX, Inc.
 
CQRS and ES with Lagom
Miel Donkers
 
Microservices with Java, Spring Boot and Spring Cloud
Eberhard Wolff
 
JAX-RS 2.1 Reloaded @ Devoxx
Santiago Pericas-Geertsen
 
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
Javier García Magna
 

Viewers also liked (20)

PDF
JavaOne LATAM 2016 - Combinando AngularJS com Java EE
Rodrigo Cândido da Silva
 
PDF
QCon SP 2016 - Construindo Microservices Auto-curáveis com Spring Cloud e Net...
Rodrigo Cândido da Silva
 
PPTX
Java8.part2
Ivan Ivanov
 
PDF
5050 dev nation
Arun Gupta
 
PDF
Server Day 2009: GlassFish 3 by Alexis Moussine-Pouchkine
JUG Genova
 
PDF
Retour JavaOne 2009
Alexis Moussine-Pouchkine
 
PPTX
From JavaEE to AngularJS
Nebrass Lamouchi
 
PPTX
JavaEE Microservices -the Payara Way
Payara
 
PDF
TDD and BDD in Java 8 - what's in it for me?
John Ferguson Smart Limited
 
PDF
JavaOne LATAM 2015 - Segurança em Recursos RESTful com OAuth2
Rodrigo Cândido da Silva
 
PDF
GUJavaSC - Unit Testing com Java EE
Rodrigo Cândido da Silva
 
PDF
Java EE Next
David Delabassee
 
PDF
GUJavaSC - Mini-curso Java EE
Rodrigo Cândido da Silva
 
PDF
GUJavaSC - Java EE 7 In Action
Rodrigo Cândido da Silva
 
PDF
JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...
Rodrigo Cândido da Silva
 
PDF
Nanoservices and Microservices with Java
Eberhard Wolff
 
PDF
Going further with CDI 1.2
Antoine Sabot-Durand
 
PPTX
AngularJS for Java Developers
Loc Nguyen
 
PDF
JavaOne LATAM 2016 - RESTful Services Simplificado com Spring Data REST
Rodrigo Cândido da Silva
 
PDF
Suportando Aplicações Multi-tenancy com Java EE
Rodrigo Cândido da Silva
 
JavaOne LATAM 2016 - Combinando AngularJS com Java EE
Rodrigo Cândido da Silva
 
QCon SP 2016 - Construindo Microservices Auto-curáveis com Spring Cloud e Net...
Rodrigo Cândido da Silva
 
Java8.part2
Ivan Ivanov
 
5050 dev nation
Arun Gupta
 
Server Day 2009: GlassFish 3 by Alexis Moussine-Pouchkine
JUG Genova
 
Retour JavaOne 2009
Alexis Moussine-Pouchkine
 
From JavaEE to AngularJS
Nebrass Lamouchi
 
JavaEE Microservices -the Payara Way
Payara
 
TDD and BDD in Java 8 - what's in it for me?
John Ferguson Smart Limited
 
JavaOne LATAM 2015 - Segurança em Recursos RESTful com OAuth2
Rodrigo Cândido da Silva
 
GUJavaSC - Unit Testing com Java EE
Rodrigo Cândido da Silva
 
Java EE Next
David Delabassee
 
GUJavaSC - Mini-curso Java EE
Rodrigo Cândido da Silva
 
GUJavaSC - Java EE 7 In Action
Rodrigo Cândido da Silva
 
JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...
Rodrigo Cândido da Silva
 
Nanoservices and Microservices with Java
Eberhard Wolff
 
Going further with CDI 1.2
Antoine Sabot-Durand
 
AngularJS for Java Developers
Loc Nguyen
 
JavaOne LATAM 2016 - RESTful Services Simplificado com Spring Data REST
Rodrigo Cândido da Silva
 
Suportando Aplicações Multi-tenancy com Java EE
Rodrigo Cândido da Silva
 
Ad

Similar to JavaOne 2016 - Reactive Microservices with Java and Java EE (20)

PDF
Nick Raienko ''Service-oriented GraphQL''
OdessaJS Conf
 
PDF
Microservices and modularity with java
DPC Consulting Ltd
 
PPTX
Micro services
Brian Perera
 
PPTX
2015.04.23 Azure Mobile Services
Marco Parenzan
 
PPTX
Cloud Powered Mobile Apps with Azure
Kris Wagner
 
PPTX
OpenStack and OpenDaylight Workshop: ONUG Spring 2014
mestery
 
PPTX
Duo World Architecture
Supun Dissanayake
 
PPTX
Intro to spring cloud &microservices by Eugene Hanikblum
Eugene Hanikblum
 
PPTX
Windows Azure - Mobile Services
Jose R Jara
 
PDF
Java Microservices_64 Hours_Day wise plan (002).pdf
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
PDF
Java Microservices_64 Hours_Day wise plan (002).pdf
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
PPTX
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Lucas Jellema
 
PDF
Innovating faster with SBT, Continuous Delivery, and LXC
kscaldef
 
PDF
AMIS Oracle OpenWorld 2013 Review Part 2 - Platform Middleware Publication
Getting value from IoT, Integration and Data Analytics
 
PPTX
Mobile Services for Windows Azure
Abhishek Sur
 
PPTX
Building multi tenancy enterprise applications - quick
uEngine Solutions
 
PDF
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Arun Gupta
 
PPTX
Application Centric Microservices from Redhat Summit 2015
Ken Owens
 
PDF
Better Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
VMware Tanzu
 
PPTX
Cloud Powered Mobile Apps with Azure
Ken Cenerelli
 
Nick Raienko ''Service-oriented GraphQL''
OdessaJS Conf
 
Microservices and modularity with java
DPC Consulting Ltd
 
Micro services
Brian Perera
 
2015.04.23 Azure Mobile Services
Marco Parenzan
 
Cloud Powered Mobile Apps with Azure
Kris Wagner
 
OpenStack and OpenDaylight Workshop: ONUG Spring 2014
mestery
 
Duo World Architecture
Supun Dissanayake
 
Intro to spring cloud &microservices by Eugene Hanikblum
Eugene Hanikblum
 
Windows Azure - Mobile Services
Jose R Jara
 
Java Microservices_64 Hours_Day wise plan (002).pdf
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Java Microservices_64 Hours_Day wise plan (002).pdf
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Microservices, Node, Dapr and more - Part One (Fontys Hogeschool, Spring 2022)
Lucas Jellema
 
Innovating faster with SBT, Continuous Delivery, and LXC
kscaldef
 
AMIS Oracle OpenWorld 2013 Review Part 2 - Platform Middleware Publication
Getting value from IoT, Integration and Data Analytics
 
Mobile Services for Windows Azure
Abhishek Sur
 
Building multi tenancy enterprise applications - quick
uEngine Solutions
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Arun Gupta
 
Application Centric Microservices from Redhat Summit 2015
Ken Owens
 
Better Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
VMware Tanzu
 
Cloud Powered Mobile Apps with Azure
Ken Cenerelli
 
Ad

More from Rodrigo Cândido da Silva (20)

PDF
Java 9, 10 e ... 11
Rodrigo Cândido da Silva
 
PDF
Cloud Native Java EE
Rodrigo Cândido da Silva
 
PDF
Protegendo Microservices: Boas Práticas e Estratégias de Implementação
Rodrigo Cândido da Silva
 
PDF
Protecting Java Microservices: Best Practices and Strategies
Rodrigo Cândido da Silva
 
PDF
As novidades da nova versão do Java 9
Rodrigo Cândido da Silva
 
PDF
Workshop Microservices - Distribuindo os Microservices com Docker e Kubernetes
Rodrigo Cândido da Silva
 
PDF
Workshop Microservices - Microservices com Spring Cloud e Netflix OSS
Rodrigo Cândido da Silva
 
PDF
Workshop Microservices - Construindo APIs RESTful com Spring Boot
Rodrigo Cândido da Silva
 
PDF
Workshop Microservices - Arquitetura Microservices
Rodrigo Cândido da Silva
 
PDF
GUJavaSC - Protegendo Microservices em Java
Rodrigo Cândido da Silva
 
PDF
TDC Floripa 2017 - Criando Microservices Reativos com Java
Rodrigo Cândido da Silva
 
PDF
GUJavaSC - Combinando Micro-serviços com Práticas DevOps
Rodrigo Cândido da Silva
 
PDF
TDC Floripa 2016 - Decolando seus micro-serviços na Spring Cloud
Rodrigo Cândido da Silva
 
PDF
GUJavaSC - Combinando AngularJS com Java EE
Rodrigo Cândido da Silva
 
PDF
QCon 2015 - Combinando AngularJS com Java EE
Rodrigo Cândido da Silva
 
PDF
TDC 2015 - Segurança em Recursos RESTful com OAuth2
Rodrigo Cândido da Silva
 
PDF
ConFoo 2015 - Supporting Multi-tenancy Applications with Java EE
Rodrigo Cândido da Silva
 
PDF
ConFoo 2015 - Securing RESTful resources with OAuth2
Rodrigo Cândido da Silva
 
PDF
JavaOne 2014 - Securing RESTful Resources with OAuth2
Rodrigo Cândido da Silva
 
PDF
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
Rodrigo Cândido da Silva
 
Java 9, 10 e ... 11
Rodrigo Cândido da Silva
 
Cloud Native Java EE
Rodrigo Cândido da Silva
 
Protegendo Microservices: Boas Práticas e Estratégias de Implementação
Rodrigo Cândido da Silva
 
Protecting Java Microservices: Best Practices and Strategies
Rodrigo Cândido da Silva
 
As novidades da nova versão do Java 9
Rodrigo Cândido da Silva
 
Workshop Microservices - Distribuindo os Microservices com Docker e Kubernetes
Rodrigo Cândido da Silva
 
Workshop Microservices - Microservices com Spring Cloud e Netflix OSS
Rodrigo Cândido da Silva
 
Workshop Microservices - Construindo APIs RESTful com Spring Boot
Rodrigo Cândido da Silva
 
Workshop Microservices - Arquitetura Microservices
Rodrigo Cândido da Silva
 
GUJavaSC - Protegendo Microservices em Java
Rodrigo Cândido da Silva
 
TDC Floripa 2017 - Criando Microservices Reativos com Java
Rodrigo Cândido da Silva
 
GUJavaSC - Combinando Micro-serviços com Práticas DevOps
Rodrigo Cândido da Silva
 
TDC Floripa 2016 - Decolando seus micro-serviços na Spring Cloud
Rodrigo Cândido da Silva
 
GUJavaSC - Combinando AngularJS com Java EE
Rodrigo Cândido da Silva
 
QCon 2015 - Combinando AngularJS com Java EE
Rodrigo Cândido da Silva
 
TDC 2015 - Segurança em Recursos RESTful com OAuth2
Rodrigo Cândido da Silva
 
ConFoo 2015 - Supporting Multi-tenancy Applications with Java EE
Rodrigo Cândido da Silva
 
ConFoo 2015 - Securing RESTful resources with OAuth2
Rodrigo Cândido da Silva
 
JavaOne 2014 - Securing RESTful Resources with OAuth2
Rodrigo Cândido da Silva
 
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
Rodrigo Cândido da Silva
 

Recently uploaded (20)

PPTX
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PDF
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
PPTX
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
PDF
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
PDF
The Growing Value and Application of FME & GenAI
Safe Software
 
PPTX
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
PDF
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
PDF
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
PPTX
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
PDF
Python Conference Singapore - 19 Jun 2025
ninefyi
 
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
PDF
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
PDF
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
PDF
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
PDF
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
PDF
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
PDF
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
PDF
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
PyCon SG 25 - Firecracker Made Easy with Python.pdf
Muhammad Yuga Nugraha
 
The Growing Value and Application of FME & GenAI
Safe Software
 
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
Python Conference Singapore - 19 Jun 2025
ninefyi
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 

JavaOne 2016 - Reactive Microservices with Java and Java EE

  • 1. Reactive Microservices with Java and Java EE Rodrigo Cândido da Silva @rcandidosilva Israel Boza Rodriguez @IsraKaos
  • 2. Agenda • Monolithic vs. Microservices • Reactive Manifesto • Resilience • Message-driven • Demo • Q&A
  • 4. Microservices • Small components • Isolated deployment • Independent technology • Separate infrastructure "Small independent component with well- defined boundaries that’s doing one thing, but doing it well"
  • 6. Resilient • How to support it on microservices? • Central point of configuration • Service registry and discovery • Routing features • Load balancing • Failover • Monitoring
  • 7. Spring BootSpring Cloud Spring Cloud + Netflix OSS
  • 8. Spring Cloud + Netflix OSS “Nice match to build resilient microservices with Java" Configuration Management Spring Cloud Config + Bus Service Registration and Discovery Netflix Eureka Load Balacing Netflix Ribbon Circuit Breaker Netflix Hystrix + Turbine Proxy Server Netflix Zuul Autenthication Spring Cloud Security
  • 12. Netflix Hystrix • Circuit Breaker Pattern
  • 15. Spring Cloud Security Discovery Client Relying Party Resource Server Get an access token & an ID Token (JWT) Use an access token Authorization Server Iden.ty Provider or IDP or OpenID Provider or OP Authorization Endpoint Token Endpoint Important Stuff Userinfo Endpoint Registration Endpoint JWKS Endpoint JWKS Endpoint Validate (JWT) ID Token /.well-known /webfinger /openid-configura.on Check Session IFrame End Session Endpoint
  • 16. Message-Driven • How to support it on microservices? • Asynchronous communication • Non blocking I/O • Distributed • Consistency • Event sourcing • CQRS
  • 17. Reactive Programming • Asynchronous communication and data streams • reactive-streams.org
  • 18. Reactive Alternatives at Java EE JMS EJB 3 Message-Driven Beans Asynchronous Session Beans CDI Events Observers Servlet Asynchronous NIO JAX-RS Async on Server Async on Client WebSocket Async Remote Endpoints Concurrency Utilities
  • 19. Project Reactor • Library for building non-blocking apps • Interacts with Java 8 functional API • Offers two reactive composable API • Flux[N] and Mono[0|1] • Supports scalable in-memory routing with Bus extensions • Ported to support microservices
  • 20. REST Endpoint @RestController public class UserRestController { private static final List<User> users = new ArrayList<>(); static { users.add(new User(1, "Rodrigo", "C", "da Silva")); users.add(new User(2, "Israel", "B", "Rodriguez")); users.add(new User(3, "Bruno", "", "Souza")); users.add(new User(4, "Edson", "", "Yanaga")); } @RequestMapping(method = RequestMethod.GET, value = "/users") public List<User> getUsers() { return users; } @RequestMapping(method = RequestMethod.GET, value = "/user/{id}") public User getUser(@PathVariable("id") Integer id) { return users.stream().filter(g -> g.getId() == id) .collect(Collectors.toList()).get(0); } }
  • 21. REST Proxy @Component public class UserServiceProxy { @Autowired UserService service; @HystrixCommand(fallbackMethod = "defaultUsersObservable") public Observable<List<User>> getUsersObservable() { return new ObservableResult<List<User>>() { @Override public List<User> invoke() { return service.getUsers(); } }; } public Observable<User> defaultUsersObservable() { return null; } } @FeignClient("USER-SERVICE") public interface UserService { @RequestMapping(value = "/users", method = RequestMethod.GET) List<User> getUsers(); @RequestMapping(value = "/user/{id}", method = RequestMethod.GET) User getUser(@PathVariable("id") Integer id); }
  • 22. REST Async Client @RestController public class APIController { @Autowired GroupServiceProxy groupService; @Autowired UserServiceProxy userService; @RequestMapping(method = RequestMethod.GET, value = "/userGroups") public UserGroup getUserGroups() { Observable<List<Group>> groups = groupService.getGroupsObservable(); Observable<List<User>> users = userService.getUsersObservable(); Observable<UserGroup> userGroupObservable = Observable.zip(groups, users, (g, u) -> new UserGroup(u, g)); return userGroupObservable.toList().toBlocking().single().get(0); } }
  • 23. Demo • Reactive Microservices • https://github.com/rcandidosilva/reactive-microservices
  • 25. Q&A ?
  • 26. References • http://projects.spring.io/spring-boot/ • http://projects.spring.io/spring-cloud/ • https://netflix.github.io/ • http://www.reactive-streams.org/ • http://www.reactivemanifesto.org/ • https://github.com/reactivemanifesto/website-manifesto/tree/master/public/pdf • https://projectreactor.io/ • http://reactivex.io/ • http://www.kennybastani.com/2016/04/event-sourcing-microservices-spring- cloud.html