SlideShare una empresa de Scribd logo
1 de 51
Descargar para leer sin conexión
Building Services with WSO2
Microservices Framework for
Java and WSO2 Application
Server
Kasun Gajasinghe & Kishanthan Thangarajah
WSO2
Agenda
• Introduction to Microservices Architecture
• Introduction to WSO2 MSF4J
– Hands-on Sessions
• Introduction to Kubernetes/Docker
• Demonstrating MSF4J deployment with Kubernetes
• Introduction to WSO2 Application Server
– Hands-on Session
Microservices Architecture
A method of developing software applications as a
suite of independently deployable, small, modular
services in which each service runs a unique process
and communicates through a well-defined,
lightweight mechanism to serve a business goal.
Microservices
http://martinfowler.com/articles/microservices.html
Inner & Outer Architecture
http://blogs.gartner.com/gary-olliffe/2015/01/30/microservices-guts-on-the-outside/
WSO2 Microservices Framework for Java (MSF4J)
• Lightweight & fast runtime
• Use Java annotations as a way of defining microservices APIs as well
as metrics
• Support well known & widely used methods such as JAX-RS
annotations
• Provide simple ways to develop & deploy microservices
• Built-in Metrics & Analytics APIs with out-of-the-box integration with
WSO2 Data Analytics Server (DAS)
• To be used in the WSO2 platform as a way of replacing all admin
services as well as defining other microservices for inter-component
interactions
MSF4J Implementation
• Based on the new WSO2 Carbon 5.0 kernel
• Transport is based on Netty 4.0
• Supports streaming
• High performance
• 5MB pack size
• Starts within 300ms
• ~25MB memory consumption for the framework
MSF4J Performance Comparison
MSF4J Memory Consumption Comparison
Core Features of MSF4J
• Quick & simple development model using simple annotations
• Lightweight & high performance
• Custom interceptors
• OAuth based security
• Metrics gathering & publishing
• Streaming input & streaming output support
• WSO2 DevStudio based tooling for generating microservices projects
starting from a Swagger API definition
• Comprehensive samples demonstrating how to develop microservices
application
MSF4J Flow & Thread Model
Developer Experience & Programming
Model
Development Model
• Maven Archetype
• IDE/Build Classpath (msf4j-all.jar)
• Tooling (Swagger -> Code)
Maven pom.xml
Maven Archetype
mvn archetype:generate
-DarchetypeGroupId=org.wso2.msf4j
-DarchetypeArtifactId=msf4j-microservice
-DarchetypeVersion=1.0.0
-DgroupId=org.example
-DartifactId=myservice
-Dversion=1.0.0-SNAPSHOT
-Dpackage=org.example.service
Example - StockQuote Microservice
Application - Main Class
Build and Run !!!
mvn clean install
java -jar stockquote-1.0.0.jar
Tooling - WSO2 Developer Studio
Types of Deployment
• Standalone, Self contained jar files
• OS / Container images
Analytics & Monitoring
Supports annotations
• Timed – measures execution
• Metered – measures rate of events
• Counted – counts the total invocations
• HTTPMonitored – monitors HTTP requests
Analytics & Monitoring
Service Metrics - Console Output
Security
• Security is done via a central server issuing JWT or
OAuth tokens.
• The OAuth2SecurityInterceptor verifies the token
before accessing the resources.
MSF4J Hands-on Sessions
Hello World!
1. Build the sample - wso2msf4j-dist-1.0.0
/samples/helloworld
mvn clean install
2. Run the sample
java -jar helloworld-*.jar
3. Test the sample
curl http://localhost:8080/hello/wso2
Generate a sample with Maven
archetype
mvn archetype:generate -
DarchetypeGroupId=org.wso2.msf4j -
DarchetypeArtifactId=msf4j-microservice
-DarchetypeVersion=1.0.0
Hands-on - Write a StudentService
• API -
– GET /student/getAll - get all students
– GET /student/get/{id} - get student with {id}
– POST /add - add a student
• Intercept requests
• Monitoring
Service class annotations
• JAX-RS HTTP resource methods - @GET @POST
@PUT @DELETE
• Content-negotiation - @Produces @Consumes
• Service lifecycle - @PreDestroy
@PostDestroy
HTTP Monitoring with Data Analytics
Server
1. Refer the sample -
wso2msf4j-1.0.0/samples/metrics-
httpmon/metrics-httpmon-fatjar
Production Deployment with
Kubernetes and Docker
Virtual Machines vs Containers
What is Docker
• Container Virtualization
• Build, pack, ship and run applications as containers
• Build once, run in many places
• Isolated
Docker Filesystem
StockQuote Service Dockerfile
Kubernetes
• Kubernetes is an open source orchestration system
for Docker containers
• Docker -> Container lifecycle management
• Kubernetes -> Orchestration and container cluster
management
“Kubernetes, I need 5 Tomcat and one
MySQL server running at all times.”
Kubernetes in a Nutshell
Kubernetes UI
PetStore sample
Petstore sample
Petstore sample
Petstore sample - deployment view
Demo - Petstore
Building Services with
WSO2 Application Server
Current status of Application Server
• Latest release - AS 5.3.0
• Built on top of WSO2 Carbon
• Embedded Apache Tomcat 7 and Apache TomEE 7
• First class support for
– JAX-WS and JAX-RS services
– JavaEE 6 Web Profile applications
Future plan for Application Server
• Upcoming release - AS 6.0
• NOT based on WSO2 Carbon or OSGi!
• Built on top of Apache Tomcat
AS 6.0
• HTTP Request Monitoring for Tomcat
• Seamless integration with WSO2 Identity Server for
SAML SSO Authentication
• Classloading improvements
Upcoming
- Integration with WSO2 API Manager for exposing
APIs. (API Everywhere!)
Hands-on Session
Questions?
Thank You

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

GUJavaSC - Criando Micro-serviços Reativos com Java
GUJavaSC - Criando Micro-serviços Reativos com JavaGUJavaSC - Criando Micro-serviços Reativos com Java
GUJavaSC - Criando Micro-serviços Reativos com Java
 
Glass fish performance tuning tips from the field
Glass fish performance tuning tips from the fieldGlass fish performance tuning tips from the field
Glass fish performance tuning tips from the field
 
Play 2 Java Framework with TDD
Play 2 Java Framework with TDDPlay 2 Java Framework with TDD
Play 2 Java Framework with TDD
 
Microservices with Spring Cloud
Microservices with Spring CloudMicroservices with Spring Cloud
Microservices with Spring Cloud
 
Integrating MQ Protocols with WSO2 ESB 4.9.0 (RabbitMQ, MQTT, Kafka)
Integrating MQ Protocols with WSO2 ESB 4.9.0 (RabbitMQ, MQTT, Kafka)Integrating MQ Protocols with WSO2 ESB 4.9.0 (RabbitMQ, MQTT, Kafka)
Integrating MQ Protocols with WSO2 ESB 4.9.0 (RabbitMQ, MQTT, Kafka)
 
JavaOne 2016 - Reactive Microservices with Java and Java EE
JavaOne 2016 - Reactive Microservices with Java and Java EEJavaOne 2016 - Reactive Microservices with Java and Java EE
JavaOne 2016 - Reactive Microservices with Java and Java EE
 
JavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir Džaferović
JavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir DžaferovićJavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir Džaferović
JavaCro'14 - Continuous deployment tool – Aleksandar Dostić and Emir Džaferović
 
Workshop MSF4J - Getting Started with Microservices and Java
Workshop MSF4J - Getting Started with Microservices and JavaWorkshop MSF4J - Getting Started with Microservices and Java
Workshop MSF4J - Getting Started with Microservices and Java
 
Reliable System Integration and Scaling with WSO2 Message Broker
Reliable System Integration and Scaling with WSO2 Message BrokerReliable System Integration and Scaling with WSO2 Message Broker
Reliable System Integration and Scaling with WSO2 Message Broker
 
Changing the world with ZeroVM and Swift
Changing the world with ZeroVM and SwiftChanging the world with ZeroVM and Swift
Changing the world with ZeroVM and Swift
 
Microservices with Spring Boot
Microservices with Spring BootMicroservices with Spring Boot
Microservices with Spring Boot
 
What's New in the Ambassador Edge Stack 1.0?
What's New in the Ambassador Edge Stack 1.0? What's New in the Ambassador Edge Stack 1.0?
What's New in the Ambassador Edge Stack 1.0?
 
Microservices with WildFly Swarm - JavaSI 2016
Microservices with WildFly Swarm - JavaSI 2016Microservices with WildFly Swarm - JavaSI 2016
Microservices with WildFly Swarm - JavaSI 2016
 
WSO2 Enterprise Service Bus - Product Overview
WSO2 Enterprise Service Bus - Product OverviewWSO2 Enterprise Service Bus - Product Overview
WSO2 Enterprise Service Bus - Product Overview
 
Building microservices with vert.x 3.0
Building microservices with vert.x 3.0Building microservices with vert.x 3.0
Building microservices with vert.x 3.0
 
Building microservices web application using scala & akka
Building microservices web application using scala & akkaBuilding microservices web application using scala & akka
Building microservices web application using scala & akka
 
Linux kit meetup_v1.0.0
Linux kit meetup_v1.0.0Linux kit meetup_v1.0.0
Linux kit meetup_v1.0.0
 
Web application I have always dreamt of
Web application I have always dreamt ofWeb application I have always dreamt of
Web application I have always dreamt of
 
Andrea Di Persio
Andrea Di PersioAndrea Di Persio
Andrea Di Persio
 
Lagom in Practice
Lagom in PracticeLagom in Practice
Lagom in Practice
 

Similar a Building Services with WSO2 Microservices framework for Java and WSO2 AS

WSO2 Intro Webinar - Scale your business with the cloud enabled WSO2 Applica...
WSO2 Intro Webinar -  Scale your business with the cloud enabled WSO2 Applica...WSO2 Intro Webinar -  Scale your business with the cloud enabled WSO2 Applica...
WSO2 Intro Webinar - Scale your business with the cloud enabled WSO2 Applica...
WSO2
 
TransitioningToMicroServonDocker_MS
TransitioningToMicroServonDocker_MSTransitioningToMicroServonDocker_MS
TransitioningToMicroServonDocker_MS
Lana Kalashnyk
 
WSO2 Application Server - 5.0.0
WSO2 Application Server - 5.0.0WSO2 Application Server - 5.0.0
WSO2 Application Server - 5.0.0
WSO2
 
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Lucas Jellema
 

Similar a Building Services with WSO2 Microservices framework for Java and WSO2 AS (20)

Building Services with WSO2 Application Server and WSO2 Microservices Framewo...
Building Services with WSO2 Application Server and WSO2 Microservices Framewo...Building Services with WSO2 Application Server and WSO2 Microservices Framewo...
Building Services with WSO2 Application Server and WSO2 Microservices Framewo...
 
WSO2 Workshop Sydney 2016 - Microservices
WSO2 Workshop Sydney 2016 - MicroservicesWSO2 Workshop Sydney 2016 - Microservices
WSO2 Workshop Sydney 2016 - Microservices
 
An Introduction to WSO2 Microservices Framework for Java
An Introduction to WSO2 Microservices Framework for JavaAn Introduction to WSO2 Microservices Framework for Java
An Introduction to WSO2 Microservices Framework for Java
 
An Introduction to WSO2 Microservices Framework for Java
An Introduction to WSO2 Microservices Framework for JavaAn Introduction to WSO2 Microservices Framework for Java
An Introduction to WSO2 Microservices Framework for Java
 
Introduction to WSO2 Microservices Framework for Java - MSF4J - WSO2Con Asia ...
Introduction to WSO2 Microservices Framework for Java - MSF4J - WSO2Con Asia ...Introduction to WSO2 Microservices Framework for Java - MSF4J - WSO2Con Asia ...
Introduction to WSO2 Microservices Framework for Java - MSF4J - WSO2Con Asia ...
 
WSO2ConUS 2015 - Introduction to WSO2 Microservices Server (MSS)
WSO2ConUS 2015 - Introduction to WSO2 Microservices Server (MSS)WSO2ConUS 2015 - Introduction to WSO2 Microservices Server (MSS)
WSO2ConUS 2015 - Introduction to WSO2 Microservices Server (MSS)
 
[WSO2Con EU 2017] Writing Microservices Using MSF4J
[WSO2Con EU 2017] Writing Microservices Using MSF4J[WSO2Con EU 2017] Writing Microservices Using MSF4J
[WSO2Con EU 2017] Writing Microservices Using MSF4J
 
Micro services
Micro servicesMicro services
Micro services
 
Event Bus as Backbone for Decoupled Microservice Choreography - Lecture and W...
Event Bus as Backbone for Decoupled Microservice Choreography - Lecture and W...Event Bus as Backbone for Decoupled Microservice Choreography - Lecture and W...
Event Bus as Backbone for Decoupled Microservice Choreography - Lecture and W...
 
WSO2 Intro Webinar - Scale your business with the cloud enabled WSO2 Applica...
WSO2 Intro Webinar -  Scale your business with the cloud enabled WSO2 Applica...WSO2 Intro Webinar -  Scale your business with the cloud enabled WSO2 Applica...
WSO2 Intro Webinar - Scale your business with the cloud enabled WSO2 Applica...
 
Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...
Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...
Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...
 
TransitioningToMicroServonDocker_MS
TransitioningToMicroServonDocker_MSTransitioningToMicroServonDocker_MS
TransitioningToMicroServonDocker_MS
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
WSO2 Application Server - 5.0.0
WSO2 Application Server - 5.0.0WSO2 Application Server - 5.0.0
WSO2 Application Server - 5.0.0
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with Docker
 
Mastering microservices - Dot Net Tricks
Mastering microservices - Dot Net TricksMastering microservices - Dot Net Tricks
Mastering microservices - Dot Net Tricks
 
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
 
Power of Azure Devops
Power of Azure DevopsPower of Azure Devops
Power of Azure Devops
 
Microservices in the Enterprise
Microservices in the Enterprise Microservices in the Enterprise
Microservices in the Enterprise
 
Global Azure Bootcamp: Azure service fabric
Global Azure Bootcamp: Azure service fabric Global Azure Bootcamp: Azure service fabric
Global Azure Bootcamp: Azure service fabric
 

Más de Kasun Gajasinghe

Survey on Frequent Pattern Mining on Graph Data - Slides
Survey on Frequent Pattern Mining on Graph Data - SlidesSurvey on Frequent Pattern Mining on Graph Data - Slides
Survey on Frequent Pattern Mining on Graph Data - Slides
Kasun Gajasinghe
 
Google Summer of Code 2011 Sinhalese flyer
Google Summer of Code  2011 Sinhalese flyer Google Summer of Code  2011 Sinhalese flyer
Google Summer of Code 2011 Sinhalese flyer
Kasun Gajasinghe
 

Más de Kasun Gajasinghe (6)

Building Services with WSO2 Microservices framework for Java and WSO2 AS
Building Services with WSO2 Microservices framework for Java and WSO2 ASBuilding Services with WSO2 Microservices framework for Java and WSO2 AS
Building Services with WSO2 Microservices framework for Java and WSO2 AS
 
Distributed caching with java JCache
Distributed caching with java JCacheDistributed caching with java JCache
Distributed caching with java JCache
 
Siddhi CEP Engine
Siddhi CEP EngineSiddhi CEP Engine
Siddhi CEP Engine
 
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
 
Survey on Frequent Pattern Mining on Graph Data - Slides
Survey on Frequent Pattern Mining on Graph Data - SlidesSurvey on Frequent Pattern Mining on Graph Data - Slides
Survey on Frequent Pattern Mining on Graph Data - Slides
 
Google Summer of Code 2011 Sinhalese flyer
Google Summer of Code  2011 Sinhalese flyer Google Summer of Code  2011 Sinhalese flyer
Google Summer of Code 2011 Sinhalese flyer
 

Último

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Último (20)

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 

Building Services with WSO2 Microservices framework for Java and WSO2 AS