Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Interoperable Microservice with Eclipse MicroProfile

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.

ivargrimstad

September 10, 2019
Tweet

More Decks by ivargrimstad

Other Decks in Technology

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 #microservices 1. Externalised Configuration 2. Health Check API 3.

    Application Metrics 4. Circuit Breaker 5. Access Token 6. Distributed Tracing
  3. @ivar_grimstad #microservices How to enable a service to run in

    multiple environments without modification?
  4. @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!”}
  5. @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!”}
  6. @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!”}
  7. @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!”}
  8. @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
  9. @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!”}
  10. @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
  11. @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
  12. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER

    THE ECLIPSE PUBLIC LICENSE 2.0 (EPL-2.0) 
 !57 Summary
  13. COPYRIGHT (C) 2019, ECLIPSE FOUNDATION, INC. | MADE AVAILABLE UNDER

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