Building Interoperable Microservice with Eclipse MicroProfile

B489790e1a844284d7cd1fa2cd6e021f?s=47 ivargrimstad
September 10, 2019

Building Interoperable Microservice with Eclipse MicroProfile

Eclipse MicroProfile is a collection of community-driven open source specifications that define an enterprise Java microservices platform. The open source approach of MicroProfile removes reliance on any single vendor’s release cycles and makes the development of microservices a natural extension of Java EE developers existing skill sets.

This session gives an introduction to Eclipse MicroProfile and the tools available to get started building portable microservices with a minimum of effort. The features of MicroProfile will be in explained in a down-to-earth and easily understandable way.

B489790e1a844284d7cd1fa2cd6e021f?s=128

ivargrimstad

September 10, 2019
Tweet

Transcript

  1. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER

    THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 
 !1 Building Interoperable Microservices with Eclipse MicroProfile Ivar Grimstad Principal Consultant, Cybercom Sweden
  2. @ivar_grimstad https://github.com/ivargrimstad https://www.linkedin.com/in/ivargrimstad

  3. @ivar_grimstad #JakartaEE #EE4J

  4. @ivar_grimstad #microservices Eclipse MicroProfile

  5. @ivar_grimstad #microservices

  6. @ivar_grimstad #microservices M icroProfile 3.0 June 11, 2019

  7. @ivar_grimstad #microservices Open Liberty

  8. @ivar_grimstad #MicroProfile #JavaEE #EE4J #JakartaEE java -jar dukes.jar

  9. @ivar_grimstad #microservices

  10. @ivar_grimstad #microservices Getting Started

  11. @ivar_grimstad #MicroProfile #JavaEE #EE4J #JakartaEE

  12. @ivar_grimstad #microservices DEMO

  13. @ivar_grimstad #microservices Microservice Patterns

  14. @ivar_grimstad #microservices

  15. @ivar_grimstad #microservices 1. Externalised Configuration 2. Health Check API 3.

    Application Metrics 4. Circuit Breaker 5. Access Token 6. Distributed Tracing
  16. @ivar_grimstad #microservices Externalised Configuration

  17. @ivar_grimstad #microservices How to enable a service to run in

    multiple environments without modification?
  18. @ivar_grimstad #microservices Configuration for MicroProfile

  19. @ivar_grimstad #microservices System Properties System.getProperties() Environment Variables System.getenv() Application Configuration

    META-INF/microprofile-config.properties
  20. @ivar_grimstad #MicroProfile #JavaEE #EE4J #JakartaEE

  21. @ivar_grimstad #microservices DEMO

  22. @ivar_grimstad #microservices Health Check API

  23. @ivar_grimstad #microservices How to detect that a running service instance

    is unable to handle requests?
  24. @ivar_grimstad #microservices MicroProfile Health API

  25. @ivar_grimstad #MicroProfile #JavaEE #EE4J #JakartaEE

  26. @ivar_grimstad #microservices DEMO

  27. @ivar_grimstad #microservices Application Metrics

  28. @ivar_grimstad #microservices How to understand the behavior of an application

    and troubleshoot problems?
  29. @ivar_grimstad #microservices MicroProfile Metrics

  30. @ivar_grimstad #MicroProfile #JavaEE #EE4J #JakartaEE

  31. @ivar_grimstad #microservices DEMO

  32. @ivar_grimstad #microservices Circuit Breaker

  33. @ivar_grimstad #microservices How to prevent a network or service failure

    from cascading to other services?
  34. @ivar_grimstad #microservices

  35. @ivar_grimstad #MicroProfile #JavaEE #EE4J #JakartaEE

  36. @ivar_grimstad #microservices DEMO

  37. @ivar_grimstad #microservices Access Token

  38. @ivar_grimstad #microservices How to communicate the identity of the requestor

    to the services that handle the request?
  39. @ivar_grimstad #microservices Basic Authentication

  40. @ivar_grimstad #microservices POST /hello HTTP/1.1 Host: localhost:8080 Authorization: Basic c25vb3850nBhc3M=

    User-Agent: HTTPie/0.9.9 Accept: */* Content-Type: application/json Content-Length: 26 {“message”:“Hello, Duke!”}
  41. @ivar_grimstad #microservices OAuth 2.0

  42. @ivar_grimstad #microservices POST /hello HTTP/1.1 Host: localhost:8080 Authorization: Bearer 2YotnF2FEjrlzCsidMWpAA

    User-Agent: HTTPie/0.9.9 Accept: */* Content-Type: application/json Content-Length: 26 {“message”:“Hello, Duke!”} POST /hello HTTP/1.1 Host: localhost:8080 Authorization: Basic c25vb3850nBhc3M= User-Agent: HTTPie/0.9.9 Accept: */* Content-Type: application/json Content-Length: 26 {“message”:“Hello, Duke!”} POST /hello HTTP/1.1 Host: localhost:8080 Authorization: Bearer 2YotnF2FEjrlzCsidMWpAA User-Agent: HTTPie/0.9.9 Accept: */* Content-Type: application/json Content-Length: 26 {“message”:“Hello, Duke!”}
  43. @ivar_grimstad #microservices JSON Web Token (JWT)

  44. @ivar_grimstad #microservices POST /hello HTTP/1.1 Host: localhost:8080 Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiQ

    mVhcmVyIiwiYXVkIjoic2ltcGxlYXBwIiwic3ViIjoiYm9iIiwidXBuIjo iYm9iIiwiY3VzdG9tQ2xhaW0iOiJjdXN0b21WYWx1ZSIsImdyb3VwcyI6W yJhZG1pbiIsInVzZXIiXSwiaXNzIjoiaHR0cDovL29wZW5saWJlcnR5Lml vIiwiZXhwIjoxNTI1MzM5MjU5LCJpYXQiOjE1MjUyNTI4NTl9.nDDpCR2w MWsENaDGORQblErOCJ6ii1R-N6iSzVsAz2RoUlvM2PrST2qT6kje-Nz9vc ptbSpOSlF1OuJydvP8Tg3puJKI5vGyL4RMowgJHwdvv7hMZvrK1loNrPfb yv727L9UwJSZMdzL_sibiXDuj-bIBIr6yGjVF86aQnh-PWBV8HHM1iW8l1 _y351lp2CAPkfjKwLU91iIT1jO1QCwItF8Dv-zAzmhd_rOIF58eB809_5r m0MMGIuAXdgUiU2bdEJQCkTWJKNNaSu5oddZzlKaCX4hIgBdrVV6447DM0 i31YRhLpYHfbzh_NlRrRPjGPNgzOIN1RInwPC8jdg_g User-Agent: HTTPie/0.9.9 Accept: */* Content-Type: application/json Content-Length: 26 {“message”:“Hello, Duke!”}
  45. @ivar_grimstad #microservices POST /hello HTTP/1.1 Host: localhost:8080 Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiQ

    mVhcmVyIiwiYXVkIjoic2ltcGxlYXBwIiwic3ViIjoiYm9iIiwidXBuIjo iYm9iIiwiY3VzdG9tQ2xhaW0iOiJjdXN0b21WYWx1ZSIsImdyb3VwcyI6W yJhZG1pbiIsInVzZXIiXSwiaXNzIjoiaHR0cDovL29wZW5saWJlcnR5Lml vIiwiZXhwIjoxNTI1MzM5MjU5LCJpYXQiOjE1MjUyNTI4NTl9.nDDpCR2w MWsENaDGORQblErOCJ6ii1R-N6iSzVsAz2RoUlvM2PrST2qT6kje-Nz9vc ptbSpOSlF1OuJydvP8Tg3puJKI5vGyL4RMowgJHwdvv7hMZvrK1loNrPfb yv727L9UwJSZMdzL_sibiXDuj-bIBIr6yGjVF86aQnh-PWBV8HHM1iW8l1 _y351lp2CAPkfjKwLU91iIT1jO1QCwItF8Dv-zAzmhd_rOIF58eB809_5r m0MMGIuAXdgUiU2bdEJQCkTWJKNNaSu5oddZzlKaCX4hIgBdrVV6447DM0 i31YRhLpYHfbzh_NlRrRPjGPNgzOIN1RInwPC8jdg_g User-Agent: HTTPie/0.9.9 Accept: */* Content-Type: application/json Content-Length: 26 {“message”:“Hello, Duke!”}
  46. @ivar_grimstad #microservices ✦Header ✦ JSON, Base64 URL Encoded ✦ Algorithm,

    Type
 ✦Payload ✦ JSON, Base64 URL Encoded ✦ Standard + Custom entries
 ✦Signature ✦ Binary, Base64 URL Encoded ✦ The actual signature
  47. @ivar_grimstad #microservices POST /hello HTTP/1.1 Host: localhost:8080 Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiQ

    mVhcmVyIiwiYXVkIjoic2ltcGxlYXBwIiwic3ViIjoiYm9iIiwidXBuIjo iYm9iIiwiY3VzdG9tQ2xhaW0iOiJjdXN0b21WYWx1ZSIsImdyb3VwcyI6W yJhZG1pbiIsInVzZXIiXSwiaXNzIjoiaHR0cDovL29wZW5saWJlcnR5Lml vIiwiZXhwIjoxNTI1MzM5MjU5LCJpYXQiOjE1MjUyNTI4NTl9.nDDpCR2w MWsENaDGORQblErOCJ6ii1R-N6iSzVsAz2RoUlvM2PrST2qT6kje-Nz9vc ptbSpOSlF1OuJydvP8Tg3puJKI5vGyL4RMowgJHwdvv7hMZvrK1loNrPfb yv727L9UwJSZMdzL_sibiXDuj-bIBIr6yGjVF86aQnh-PWBV8HHM1iW8l1 _y351lp2CAPkfjKwLU91iIT1jO1QCwItF8Dv-zAzmhd_rOIF58eB809_5r m0MMGIuAXdgUiU2bdEJQCkTWJKNNaSu5oddZzlKaCX4hIgBdrVV6447DM0 i31YRhLpYHfbzh_NlRrRPjGPNgzOIN1RInwPC8jdg_g User-Agent: HTTPie/0.9.9 Accept: */* Content-Type: application/json Content-Length: 26 {“message”:“Hello, Duke!”}
  48. @ivar_grimstad #microservices { “alg”: “RS256”, “typ”: “JWT} { “token-type: “access-token”,

    “username”: “duke”, “scopes”: [ “java”: “everywhere” ], “exp”: 1474280963, “iat”: 1474279163 “jti”: “66881b068b249ad9” } nDDpCR2wMWsENaDGORQblErOCJ6ii1R-N6iSzVsAz2RoUlvM2PrST2qT6kje-Nz 9vcptbSpOSlF1OuJydvP8Tg3puJKI5vGyL4RMowg-JHwdvv7hMZvrK1loNrPfby v727L9UwJSZMdzL_sibiXDuj-bIBIr6yGjVF86aQnh-PWBV8HHM1iW8l1_y351l p2CAPkfjKwLU91iIT1jO1QCwItF8Dv-zAzmhd_rOIF58eB809_5rm0MMGIuAXdg UiU2bdEJQCkTWJKNNaSu5oddZzlKaCX4hIgBdrVV6447DM0i31YRhLpYHfbzh_N lRrRPjGPNgzOIN1RInwPC8jdg_g
  49. @ivar_grimstad #MicroProfile #JavaEE #EE4J #JakartaEE

  50. @ivar_grimstad #microservices DEMO

  51. @ivar_grimstad #microservices Distributed Tracing

  52. @ivar_grimstad #microservices How to understand the behavior of an application

    and troubleshoot problems?
  53. @ivar_grimstad #microservices

  54. @ivar_grimstad #MicroProfile #JavaEE #EE4J #JakartaEE

  55. @ivar_grimstad #microservices End-to-End
 DEMO

  56. @ivar_grimstad #microservices hello capitalize birthday Retry + Fallback Fallback http://localhost:8181/hello?name=duke

    http://localhost:8282/birthday/duke?date=1995-05-23 http://localhost:8080/capitalize/duke { name: "Duke", daysToBirthday: 304, daysSinceBirthday: 62, age: 24 } Duke Hello Duke! You are 24 years old. It has gone 62 days since your birthday and it is 304 days left to your next... Response Response Response Ope
  57. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER

    THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 
 !57 Summary
  58. @ivar_grimstad #microservices

  59. @ivar_grimstad #microservices and

  60. @ivar_grimstad #microservices Microservice Architecture http://microservices.io Samples https://github.com/ivargrimstad Microprofile http://microprofile.io Jakarta

    EE https://jakarta.ee
  61. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER

    THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 
 !61 Thank you!