Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Building Services with WSO2
Microservices Framework for Java and
WSO2 Application Server
Sagara Gunathunga & Sameera Jayas...
Agenda
• Introduction to Microservices Architecture
• Introduction to WSO2 MSF4J
– Hands-on Sessions
• Introduction to Kub...
Microservices Architecture
A method of developing software applications as a suite of
independently deployable, small, mod...
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 mic...
MSF4J Implementation
• Based on the new WSO2 Carbon 5.0 kernel
• Transport is based on Netty 4.0
• Supports streaming
• Hi...
MSF4J Performance Comparison
MSF4J Memory Consumption Comparison
Core Features of MSF4J
• Quick & simple development model using simple annotations
• Lightweight & high performance
• Cust...
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
-Darchet...
Example - StockQuote Microservice
Application - Main Class
Application - Main Class
Build and Run !!!
mvn clean install
java -jar stockquote-1.0.0.jar
Tooling - WSO2 Developer Studio
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 – c...
Analytics & Monitoring
Service Metrics - Console Output
Security
• Security is done via a central server issuing JWT or OAuth
tokens.
• The OAuth2SecurityInterceptor verifies the...
MSF4J Hands-on Sessions
Hello World!
1.Build the sample - wso2msf4j-dist-
1.0.0/samples/helloworld
mvn clean install
1.Run the sample
java -jar he...
Generate a sample with Maven archetype
mvn archetype:generate -
DarchetypeGroupId=org.wso2.msf4j -
DarchetypeArtifactId=ms...
Production Deployment with
Kubernetes and Docker
The Essence of Micro-Services
• Micro-Services are all about…
– Proper granularity of components
– Independent deployment
...
The Essence of Micro-Services
• No shared DBs
• Transactions
• Forward Compatibility
• Micro service security
• Compositio...
Inner & Outer Architecture
http://blogs.gartner.com/gary-olliffe/2015/01/30/microservices-guts-on-the-outside/
Virtual Machines vs Containers
What is Docker
• Container Virtualization
• Build, pack, ship and run applications as containers
• Build once, run in many...
Docker File System
StockQuote Service Dockerfile
Petstore sample
Petstore sample
PetStore sample
Kubernetes
• Kubernetes is an open source orchestration system for
Docker containers
• Docker -> Container lifecycle manag...
Kubernetes in a Nutshell
Kubernetes Work Units
• Pods - Generally represents one or more containers that
should be controlled as a single “applicat...
Kubernetes UI
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 ...
Future plan for Application Server
• Upcoming release - AS 6.0
• NOT based on WSO2 Carbon or OSGi!
• Built on top of Apach...
AS 6.0
• HTTP Request Monitoring for Tomcat
• Seamless integration with WSO2 Identity Server for
SAML SSO Authentication
•...
Questions?
Thank You!
#WSO2ConEU
Share your feedback for this session
wso2con.com/app
Building Services with WSO2 Application Server and WSO2 Microservices Framework for Java
Upcoming SlideShare
Loading in …5
×

Building Services with WSO2 Application Server and WSO2 Microservices Framework for Java

361 views

Published on

Building Services with WSO2 Application Server and WSO2 Microservices Framework for Java

Published in: Software
  • Be the first to comment

  • Be the first to like this

Building Services with WSO2 Application Server and WSO2 Microservices Framework for Java

  1. 1. Building Services with WSO2 Microservices Framework for Java and WSO2 Application Server Sagara Gunathunga & Sameera Jayasoma
  2. 2. 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
  3. 3. 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.
  4. 4. Microservices http://martinfowler.com/articles/microservices.html
  5. 5. Inner & Outer Architecture http://blogs.gartner.com/gary-olliffe/2015/01/30/microservices-guts-on-the-outside/
  6. 6. 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
  7. 7. 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
  8. 8. MSF4J Performance Comparison
  9. 9. MSF4J Memory Consumption Comparison
  10. 10. 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
  11. 11. MSF4J Flow & Thread Model
  12. 12. Developer Experience & Programming Model
  13. 13. Development Model • Maven Archetype • IDE/Build Classpath (msf4j-all.jar) • Tooling (Swagger -> Code)
  14. 14. Maven pom.xml
  15. 15. 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
  16. 16. Example - StockQuote Microservice
  17. 17. Application - Main Class
  18. 18. Application - Main Class
  19. 19. Build and Run !!! mvn clean install java -jar stockquote-1.0.0.jar
  20. 20. Tooling - WSO2 Developer Studio
  21. 21. Tooling - WSO2 Developer Studio
  22. 22. Types of Deployment • Standalone, Self contained jar files • OS / Container images
  23. 23. Analytics & Monitoring Supports annotations • Timed – measures execution • Metered – measures rate of events • Counted – counts the total invocations • HTTPMonitored – monitors HTTP requests
  24. 24. Analytics & Monitoring
  25. 25. Service Metrics - Console Output
  26. 26. Security • Security is done via a central server issuing JWT or OAuth tokens. • The OAuth2SecurityInterceptor verifies the token before accessing the resources.
  27. 27. MSF4J Hands-on Sessions
  28. 28. Hello World! 1.Build the sample - wso2msf4j-dist- 1.0.0/samples/helloworld mvn clean install 1.Run the sample java -jar helloworld-*.jar 1.Test the sample curl http://localhost:8080/hello/wso2 Demo samples - https://github.com/sagara-gunathunga/msf4j-intro-webinar-samples
  29. 29. Generate a sample with Maven archetype mvn archetype:generate - DarchetypeGroupId=org.wso2.msf4j - DarchetypeArtifactId=msf4j-microservice - DarchetypeVersion=1.0.0
  30. 30. Production Deployment with Kubernetes and Docker
  31. 31. The Essence of Micro-Services • Micro-Services are all about… – Proper granularity of components – Independent deployment • They are not a counter-proposal to SOA • They do not prove that SOA failed – In the opposite: they require loose coupling,... • They require a methodology to determine “proper granules” for components – Something like the holy grail of software engineering for decades! – So, don’t expect your middleware vendors to solve this problem for you! It’s all about YOU solving an very difficult architecture/design problem!!!
  32. 32. The Essence of Micro-Services • No shared DBs • Transactions • Forward Compatibility • Micro service security • Composition with other micro services • Service Discovery • Routing • Monitoring • Automation
  33. 33. Inner & Outer Architecture http://blogs.gartner.com/gary-olliffe/2015/01/30/microservices-guts-on-the-outside/
  34. 34. Virtual Machines vs Containers
  35. 35. What is Docker • Container Virtualization • Build, pack, ship and run applications as containers • Build once, run in many places • Lightweight, Isolated
  36. 36. Docker File System
  37. 37. StockQuote Service Dockerfile
  38. 38. Petstore sample
  39. 39. Petstore sample
  40. 40. PetStore sample
  41. 41. 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.”
  42. 42. Kubernetes in a Nutshell
  43. 43. Kubernetes Work Units • Pods - Generally represents one or more containers that should be controlled as a single “application". • Services - A unit that act as a basic load balancer for other containers. • Replication Controllers - Concept of a replicated pod. Handles horizontal scaling of containers / pods. Maintain the desired number of containers.
  44. 44. Kubernetes UI
  45. 45. Petstore sample - deployment view
  46. 46. Demo - Petstore
  47. 47. Building Services with WSO2 Application Server
  48. 48. 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
  49. 49. Future plan for Application Server • Upcoming release - AS 6.0 • NOT based on WSO2 Carbon or OSGi! • Built on top of Apache Tomcat
  50. 50. AS 6.0 • HTTP Request Monitoring for Tomcat • Seamless integration with WSO2 Identity Server for SAML SSO Authentication • Classloading improvements
  51. 51. Questions?
  52. 52. Thank You! #WSO2ConEU Share your feedback for this session wso2con.com/app

×