Spring BootユーザのためのArmeria入門 #jsug / Introduce to Armeria for Spring users

Spring BootユーザのためのArmeria入門 #jsug / Introduce to Armeria for Spring users

JSUG勉強会 2020年その6 LT大会!
https://jsug.doorkeeper.jp/events/109767

see also:
JSUG勉強会で「Spring BootユーザのためのArmeria入門」というタイトルでLTしました
https://matsumana.info/blog/2020/07/30/introduce-to-armeria-for-spring-users/

0a98ad166f9cdf8d27d92c37438c6e9d?s=128

Manabu Matsuzaki

July 30, 2020
Tweet

Transcript

  1. Spring BootϢʔβͷͨΊͷArmeriaೖ໳ JSUGษڧձ 2020೥ͦͷ6 LTେձʂ 2020/07/30 @matsumana

  2. ࣗݾ঺հ • ໊લɿ দ࡚ ֶ • ॴଐɿ LINE Fukuoka •

    Roleɿ SRE • Twitterɿ @matsumana • Springྺɿ 6೥൒͘Β͍ ʢॳΊͯͷSpring͸Spring Boot 1.0.0 RC or 0.5.0ͩͬͨͱࢥ͍·͢ʣ
  3. Agenda • Armeriaೖ໳ • ArmeriaΛಋೖ͢Δྫͱͯ͠ɺSpring BootͰ࣮૷͞Εͨ αʔϏε΁ͷಋೖγφϦΦΛߟ͑ͯΈΔ

  4. Armeriaೖ໳

  5. ࢀߟࢿྉ • Official site: https://armeria.dev • GitHub repo: https://github.com/line/armeria •

    LINE DEVELOPER DAY 2019ͰͷTrustin͞Μͷηογϣϯ ʮArmeriaɿͲ͜Ͱ΋໾ཱͭϚΠΫϩαʔϏεϑϨʔϜϫʔΫʯ • https://linedevday.linecorp.com/jp/2019/sessions/D2-2 • https://youtu.be/lii7oNzAOx0 • https://speakerdeck.com/line_devday2019/armeria-a-microservice- framework-well-suited-everywhere
  6. Features • Completely asynchronous and reactive (like Spring WebFlux) •

    HTTP/2 • Supports HTTP/2 on both TLS and cleartext connections • Integration with gRPC and Thrift • Features for building microservices • Circuit breaker, Client-side load-balancing, Service discovery(DNS etc), Distributed tracing(Zipkin integration), Metrics(with Micrometer), etc • Interactive web-based debug console (like Swagger) • Compatibility with existing Java EE web applications • etc
  7. Example REST API server *Springͷػೳ͸DI·ΘΓ͚ͩ࢖ͬͯɺArmeriaͰAPIαʔόΛॻ͘ྫ

  8. Example HTTP client (with Retrofit) *Retrofit͸ඞਢͰ͸͋Γ·ͤΜɻWebClientΛͦͷ··࢖͏ࣄ΋ग़དྷ·͢

  9. Example gRPC server

  10. Example gRPC server

  11. Example gRPC client

  12. ArmeriaΛಋೖ͢Δྫͱͯ͠ Spring BootͰ࣮૷͞ΕͨαʔϏε΁ͷ ಋೖγφϦΦΛߟ͑ͯΈΔ

  13. طଘͷJavaΞϓϦʹArmeriaΛ૊ΈࠐΉ৔߹ • Armeria͸طଘͷJavaΞϓϦʹ૊ΈࠐΜͰҰॹʹ࢖͑·͢ • ৄ͘͠͸ɺLINE DEVELOPER DAY 2019ͰͷTrustin͞Μͷηογϣϯ ʮArmeriaɿͲ͜Ͱ΋໾ཱͭϚΠΫϩαʔϏεϑϨʔϜϫʔΫʯ Λࢀর͍ͯͩ͘͠͞

    • https://linedevday.linecorp.com/jp/2019/sessions/D2-2
  14. ϚΠΫϩαʔϏεΞʔΩςΫνϟ΁Ҡߦ͢Δ৔߹ • طʹSpring BootͰ࣮૷͞ΕͨαʔϏε͕͋ͬͯɺ ࠓޙϚΠΫϩαʔϏεΞʔΩςΫνϟʹҠߦ͍͖͍ͯͨ͠ ྫ) • ৽ػೳΛϚΠΫϩαʔϏεͱ࣮ͯ͠૷͍ͨ͠ or •

    طଘͷϞϊϦεΛϚΠΫϩαʔϏεʹ෼ׂ͍͖͍ͯͨ͠ • ϚΠΫϩαʔϏεؒͷ௨৴͸gRPCͰߦ͍͍ͨ
  15. ϚΠΫϩαʔϏε΁ͷҠߦ ύλʔϯ1 • طଘͷϞϊϦε͕৽͍͠ϚΠΫϩαʔϏε΁ͷϧʔςΟϯάΛߦ͏ αϯϓϧιʔείʔυ https://github.com/matsumana/armeria-example-for-jsug

  16. ϚΠΫϩαʔϏε΁ͷҠߦ ύλʔϯ2 • લஈʹAPI GatewayΛཱͯͯɺϧʔςΟϯά΍αʔϏεશମͷ ڞ௨ॲཧʢrate limiter, ೝূ, etcʣΛߦ͏ αϯϓϧιʔείʔυ

    https://github.com/matsumana/armeria-example-for-jsug
  17. ͦͷଞͷαϯϓϧΞϓϦ • Official examples https://github.com/line/armeria/tree/master/examples • Armeriaͷ৭ʑͳػೳΛ࢖ͬͨαϯϓϧΞϓϦ https://github.com/matsumana/armeria-sandbox • Circuit

    Breaker, Client-side load balancing, Service discovery(Central Dogma based), Zipkin integration, Rate limiter, Automatic retry ͳͲؚ͕·Ε͍ͯ·͢
  18. Thank you :)