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.

WSO2 Microservices Framework for Java - Product Overview

269 views

Published on

WSO2 MSF4J is a lightweight, fast runtime and an annotation-based programming model, to create microservices in Java with container-based deployment in mind.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

WSO2 Microservices Framework for Java - Product Overview

  1. 1. WSO2 Microservices Framework for Java 2.0.0 Overview
  2. 2. Agenda •  Introduction •  Core Features •  Performance •  Deployment 2  
  3. 3. Introduction 3  
  4. 4. Microservices •  Small independent processes achieving small tasks, which work together to ultimately compose a complex application 4   Ref: http://martinfowler.com/articles/microservices/images/sketch.png
  5. 5. Microservices Architecture •  Modular and composable •  Easy to maintain - Components can be easily replaced and bugs in one component can be fixed without affecting others •  Highly scalable •  Easy deployment 5  
  6. 6. WSO2 Microservices Framework for Java •  A lightweight, high performance framework for building microservices in Java •  Simple Java based programming model with JAX-RS and Swagger based annotations •  Fast boot up - microservices can be booted in a few milliseconds in a Docker container and can be easily added to a Docker image •  Secures microservices leveraging JWT, BasicAuth and OAuth2 and has the capability to integrate with third-party authentication servers •  Monitors microservices service behavior with analytics dashboards 6  
  7. 7. Vision of WSO2 MSF4J •  Lightweight and fast runtime •  Use Java annotations as a way of defining microservices APIs as well as met •  Provide simple ways to develop and deploy microservices •  Built-in metrics and analytics APIs with OOB integration with WSO2 Data Analytics Server (WSO2 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  
  8. 8. Implementation of WSO2 MSF4J •  Based on the new WSO2 Carbon 5.0 Kernel •  Transport is based on Netty 4.0 •  Supports streaming •  High performance •  9MB pack size •  Starts within 300 ms •  Less than 25 MB memory consumption for the framework 8  
  9. 9. Core Features 9  
  10. 10. Annotation-based Programming Model •  Supports JAX-RS based annotations •  Class-level annotations •  Method-level annotations •  Parameter-level annotations •  Lifecycle callback method annotations •  Supports Swagger based annotations •  Enables generating Swagger API definition from a single API call •  Humans and computers can discover and understand the capabilities of each service 10  
  11. 11. Spring-based Microservices •  WSO2 MSF4J Supports a Spring-native development model with •  Dependency Injection (DI) •  Standard configuration annotations (e.g. @Configuration, @Component, @AutoWired) •  Makes it easy to bring in other 3rd party libraries & wire them in at runtime •  For example those who are familiar with Spring-JPA can use the Spring-JPA library to integrate the Hibernate ORM framework with an WSO2 MSF4J service 11  
  12. 12. Server-less Execution •  Supports server-less execution with fat JAR •  Fat JAR is a JAR file with all dependencies in one fat (uber) JAR •  Creating a fat JAR and running it in a Java process is referred to as server-less execution •  Server-less execution does not involve unzipping a file and helps to start an app without a shell script •  Supports service lifecycle methods •  Easy to run within a container-friendly model 12  
  13. 13. Streaming •  WSO2 MSF4J adopts an efficient model to handle Streaming Input (request messages) and Streaming Output (response messages) •  Streaming Input - HTTP chunked requests can be handled in two ways: •  Zero-copy method – Each chunk of a request is treated separately •  chunk() method is called when requests arrive •  finished () method is called after the last chunk arrives •  error () method called if an error occurs while processing the request •  Chunk aggregation – Aggregates all chunks of the request and presents it as a full http request to the resource method •  Streaming Output – Useful when handling large data volumes – no need to load into memory 13  
  14. 14. Custom Interceptors •  Custom interceptors can be used to perform certain actions before or after a request arrives to resource methods •  Custom interceptors should implement theorg.wso2.msf4j.Interceptor interface 14  
  15. 15. File Handling •  Serve files from the resource methods by returning either of the following •  java.io.File •  java.io.InputStream •  javax.ws.rs.core.Response object with a java.io.File •  java.io.InputStream entity •  Streaming is supported by default for java.io.File and java.io.InputStream entities •  javax.ws.rs.core.StreamingOutput is also supported by WSO2 MSF4J - provides the service author more control over the chunk size 15  
  16. 16. Templates •  Enables dynamic Web pages to be easily developed as microservices •  Any data model can be easily rendered with a template and exposed as a REST service using this concept 16  
  17. 17. Exception Mapper •  Supports JAXRS ExceptionMapper, which allows the creation of custom responses when exceptions are thrown from MSF4J services •  The following code segment shows how ExceptionMappers are registered with the WSO2 MSF4J runtime: 17  
  18. 18. Circuit Breaker •  Nygard's circuit breaker pattern is supported in WSO2 MSF4J using the Netflix Hystrix library 18  
  19. 19. Thread Model 19  
  20. 20. Security •  Security is done via a central server issuing JWT tokens •  The JWTSecurityInterceptor verifies the signature, expiry and claims in the token 20  
  21. 21. Analytics and Monitoring •  Supports annotations •  Timed – measures execution time •  Metered – measures rate of events •  Counted – counts the total number of invocations •  HTTPMonitored – monitors HTTP requests 21  
  22. 22. Metrics Output to Console 22  
  23. 23. JMX Metrics 23  
  24. 24. Dashboards 24  
  25. 25. Performance 25  
  26. 26. 26  
  27. 27. 27  
  28. 28. 28  
  29. 29. 29  
  30. 30. 30  
  31. 31. 31  
  32. 32. Deployment 32  
  33. 33. 33   WSO2 Platform Deployment Options o  Stand-­‐alone  servers   o  Private  clouds:     e.g.  Stratos,  Kubernetes   o  Public  Clouds:     e.g.  AWS   o  Hybrid  deployments     o  Dedicated  hosKng  of  any  WSO2-­‐based   soluKons   o  WSO2  operaKons  team  is  managing   the  deployment  and  keeps  it  running   o  99.99%  upKme  SLA   o  Any  AWS  region  of  choice   o  Can  be  VPNed  to  local  network   o  Includes  monitoring,  backups,   patching,  updates   o  Shared  public  cloud,   o  Currently  available  for  applicaKon  and   API  hosKng  (hosted  API  Manager  and   App  Factory),   o  Preset  mulKtenant  deployment  in  AWS   US  East  run  by  WSO2,   o  Month-­‐to-­‐month  credit  card  payment    
  34. 34. CONTACT US !

×