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

実践して分かったJavaマイクロサービス開発 #JavaDayTokyo

実践して分かったJavaマイクロサービス開発 #JavaDayTokyo

Java Day Tokyo 2016
2016/05/24

Shin Tanimoto

May 24, 2016
Tweet

More Decks by Shin Tanimoto

Other Decks in Programming

Transcript

  1. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Who

    am I? 2 • ୩ຊ ৺ (Shin Tanimoto) - Acroquest Technology גࣜձࣾ - Javaτϥϒϧγϡʔλʔ - ೔ຊJavaϢʔβάϧʔϓװࣄ
 Twitter : @cero_t - Facebook : shin.tainmoto
  2. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ࣭໰ 3
  3. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ։ൃऀͷํʁ 4
  4. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏε͸
 ͲΕ͙Β͍ฉ͍ͨ͜ͱ͕͋Δʁ 5
  5. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 1. ໊લΛฉ͍ͨ͜ͱ͸͋Δ 2. ֓ཁ͙Β͍͸஌͍ͬͯΔ 3. ։ൃͨ͜͠ͱ͕͋Δ 4. ӡ༻͍ͯ͠Δ 5. ׬શʹϚελʔͨ͠ 6
  6. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. No.5ʁ ؼ͍ͬͯͩ͘͞ʂʂ 7
  7. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏεͱ͸ʁ 8
  8. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏε͸
 খ͞ͳαʔϏεͷू߹ମͱͯ͠
 ߏங͞ΕͨγεςϜͰ͋Δ 9
  9. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏε͸
 ໨ࢦ͢΋ͷͰ͸ͳ͘
 ݁Ռ࿦Ͱ͋Δ 10
  10. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏε͸
 ϓϩάϥϛϯάͷख๏Ͱ͸ͳ͍ 11
  11. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏε͸
 ઃܭɺ࣮૷ɺσϓϩΠɺӡ༻ͳͲ
 ଟذʹΘͨΔ֓೦Ͱ͋Δ 12
  12. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ΦϥΠϦʔͷ
 ϚΠΫϩαʔϏε
 ΞʔΩςΫνϟ 13
  13. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 1ষ ϚΠΫϩαʔϏε 2ষ ਐԽతΞʔΩςΫτ 3ষ αʔϏεͷ
 ɹɹϞσϧԽํ๏ 4ষ ౷߹ 5ষ ϞϊϦεͷ෼ׂ 6ষ σϓϩΠ 14 7ষ ςετ 8ষ ؂ࢹ 9ষ ηΩϡϦςΟ 10ষ ίϯ΢ΣΠͷ๏ଇͱ
 ɹɹ γεςϜઃܭ 11ষ େن໛ͳ
 ɹɹ ϚΠΫϩαʔϏε 12ষ ·ͱΊ
  14. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 1.1 ϚΠΫϩαʔϏεͱ͸ 1.1.1 খ͘͞ɺ͔ͭ1ͭͷ໾ׂʹઐ೦ 1.1.2 ࣗ཯ੑ 1.2 ओͳར఺ 1.2.1 ٕज़ҟ࣭ੑ 1.2.2 ճ෮ੑ 1.2.3 εέʔϦϯά 1.2.4 σϓϩΠͷ༰қੑ 1.2.5 ૊৫໘ͷҰக 1.2.6 ߹੒Մೳੑ 1.2.7 ަ׵Մೳʹ͢ΔͨΊͷ࠷దԽ 15
  15. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ϚΠΫϩαʔϏε͸
 ૊৫࿦΍จԽ࿦ʹ·ͰࢸΔ֓೦ 16
  16. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 1. ϚΠΫϩαʔϏεԽ΁ͷऔΓ૊Έ 2. ·ͣ͸APIԽ 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ 4. ϚΠΫϩαʔϏετϥΠΞϧୈೋ஄ 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ 6. ࠓޙɺऔΓ૊Έ͍ͨ͜ͱ 7. ຊ౰ʹϚΠΫϩαʔϏε͸࠷ద͔ʁ 17 Table of contents
  17. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 18 #1 ϚΠΫϩαʔϏεԽ
 ΁ͷऔΓ૊Έ
  18. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 1. ϚΠΫϩαʔϏεԽ΁ͷऔΓ૊Έ ର৅ͷγεςϜ ECαΠτ ߪೖϖʔδ όοΫΤϯυͷγεςϜ ߏ੒ Java SE 6 JBoss AS 6 Struts2 Hibernate3 MySQL 5.1 19
  19. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. Start simple, not small 20
  20. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ঃʑʹߏ੒มߋ 1. αʔόαΠυϨϯμϦϯάܥͷγεςϜ
 ɹɹˣ 2. ߪೖαΠτΛHTML5 + WebAPIʹ෼ׂ
 ɹɹˣ 3. όοΫΤϯυγεςϜΛϚΠΫϩαʔϏεԽ
 ɹɹˣ 4. ؅ཧը໘ΛϚΠΫϩαʔϏεԽ
 ɹɹˣ 5. ߪೖαΠτΛϚΠΫϩαʔϏεԽ 21 1. ϚΠΫϩαʔϏεԽ΁ͷऔΓ૊Έ
  21. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 22 #2 ·ͣ͸APIԽ
  22. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 2. ·ͣ͸APIԽ ΍ͬͨ͜ͱ 1. Struts2 + Hibernateͷ
 αʔόαΠυϨϯμϦϯάܥγεςϜΛɺ
 Angular1 + SpringMVCͰWeb APIԽ 2. AWS্Ͱ։ൃ/ߏங 3. యܕతͳτϥϯβΫγϣϯεΫϦϓτ • Controller • Service • Dao 23
  23. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 2. ·ͣ͸APIԽ ྑ͔ͬͨ͜ͱ 1. ը໘ͱAPIͰɺ׬શͳ෼ۀ͕Ͱ͖ͨ 2. Ұ෦ͷ஗͍ॲཧʹɺը໘શମͷඳը͕
 Ҿ͖ͣΒΕΔ͜ͱ͕ͳ͘ͳͬͨ 3. ݕࡧAPIΛ࠶ར༻ͯ͠ɺ
 ผͷը໘Λ࡞੒͢Δ͜ͱ͕Ͱ͖ͨɻ 24
  24. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 2. ·ͣ͸APIԽ ࣦഊͨ͜͠ͱ 1. APIΛը໘ʹಛԽ͗ͨ͢͠ʢ࠶ར༻ͮ͠Β͍ʣ • ঎඼৘ใɺࡏݿɺྉۚΛɺ·ͱΊͯฦ͢API • ͨͿΜ͜ΕAPIԽ͋Δ͋Δͩͱࢥ͏ 2. ങ͍෺͔͝ΛηογϣϯʹೖΕͨ • εςΟοΩʔηογϣϯʹͤ͟ΔΛಘͣɺ
 ࠶σϓϩΠ΍ɺεέʔϧΞ΢τɺεέʔϧΠϯ͕
 ͮ͠Β͍ߏ੒ʹͳͬͯ͠·ͬͨɻ 25
  25. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 2. ·ͣ͸APIԽ ࠔͬͨ͜ͱ 1. APIαʔόͷεέʔϧΞ΢τ • APIαʔόΛ૿΍ͨ͢ͼʹɺ • Webαʔό (nginx) ͷઃఆΛ • ॻ͖׵͑ͳͯ͘͸͍͚ͳ͍ɻ
 ɹˠ Webαʔό͸localhostͷAPIαʔόͷΈʹ
 ɹɹసૹ͢ΔܗͰɺWeb + APIͷηοτͰ૿΍͢ɻ 26
  26. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 2. ·ͣ͸APIԽ ࠔͬͨ͜ͱ 2. ٸʹʮॲཧΛඇಉظʹ͢Δʯͱ͍͏ཁ͕݅ු্ • ඇಉظʹ͢ΔͨΊͷΞϨίϨ͸༻ҙͯ͠ͳ͍Αʁ
 ɹˠ γϦΞϥΠζͯ͠ϑΝΠϧʹॻ͖ग़ͯ͠ɺ
 ɹɹͦΕΛඇಉظଆͷॲཧͰఆظಡΈࠐΈ͢Δ
 ɹɹͱ͍͏ݪ࢝తͳํ๏Λར༻ɻ 27
  27. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 2. ·ͣ͸APIԽ ࣍ʹ޲͚ͯ 1. APIΛը໘ʹಛԽ͗ͨ͢͠ • ϚΠΫϩαʔϏεͱ͍͏ݴ༿͕͋ΔΒ͍͠ɻಋೖ͍ͨ͠ɻ 2. ങ͍෺͔͝ΛηογϣϯʹೖΕͨ • εςʔτϨεߏ੒ʹ͍ͨ͠ 3. APIαʔόͷεέʔϧΞ΢τ • ϩʔυόϥϯγϯάͷपΓΛࣗಈԽ͍ͨ͠ 4. ٸʹʮॲཧΛඇಉظʹ͢Δʯͱ͍͏ཁ͕݅ු্ • ඇಉظॲཧͷ࢓૊ΈΛඪ४Խ͍ͨ͠ 28
  28. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 29 #3 ϚΠΫϩαʔϏε
 τϥΠΞϧୈҰ஄
  29. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ΍ͬͨ͜ͱ 1. όοΫΤϯυͷॲཧΛϚΠΫϩαʔϏεͰ࡞੒ • ঎඼৘ใαʔϏεɺࡏݿαʔϏεɺྉۚαʔϏ εͳͲʹ෼ׂ 2. ٕज़ελοΫ • Spring Bootʢ1.2ܥʣ • Spring Cloudʢޙड़ʣ 30
  30. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ΍ͬͨ͜ͱ 1. όοΫΤϯυͷॲཧΛϚΠΫϩαʔϏεͰ࡞੒ • ঎඼৘ใαʔϏεɺࡏݿαʔϏεɺྉۚαʔϏεͳͲʹ෼ׂ 2. ॲཧͷڞ௨Խ • ಉظ HTTPʢ໭Γ஋͋Γʣ • ඇಉظ AMQPʢ໭Γ஋ͳ͠ʣ • RabbitMQΛ࠾༻ • ඇಉظ AMQPʢ໭Γ஋ or ίʔϧόοΫؔ਺ʣ • ඇಉظ HTTPʢ໭Γ஋ or ίʔϧόοΫؔ਺ʣ • ͜ΕΒ͸ར༻͠ͳ͍ 31
  31. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 1. ಉظॲཧɺඇಉظॲཧͱ΋ʹɺ
 ґଘΛ໌֬Խ͢Δ 32 ItemAccessor
 (Client) ItemController
 (Server) HTTP
 AMQP
  32. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 1. ಉظॲཧɺඇಉظॲཧͱ΋ʹɺ
 ґଘΛ໌֬Խ͢Δ 33 ItemService
 (interface) ItemAccessor
 (Client) ItemController
 (Server) HTTP
 AMQP implements implements
  33. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 1. ಉظॲཧɺඇಉظॲཧͱ΋ʹɺ
 ґଘΛ໌֬Խ͢Δ • ΫϥΠΞϯτଆɺαʔόଆͷίϯτϩʔϥ͕
 ಉ͡ΠϯλϑΣʔεΛ࣮૷͢Δ͜ͱͰɺ
 IDEͷOpen Call HierarchyʹΑΔ
 ݺͼग़͠ͷτϨʔε͕Ͱ͖Δ 34
  34. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 2. αʔϏεσΟεΧόϦʢEurekaʣͷಋೖ • Netflix͕ࣾOSSͰఏڙ͍ͯ͠Δ
 αʔϏεσΟεΧόϦͷ࢓૊Έ • ಈతʹ࢖͑ΔDNSతͳ΋ͷ 35
  35. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 2. αʔϏεσΟεΧόϦʢEurekaʣͷಋೖ 36 Eureka
 Server ItemAccessor
 (Client) ItemController
 (Server) ᶃىಈ࣌ʹࣗ਎ͷ
 ɹϗετ໊ͱ
 ɹϙʔτ൪߸Λొ࿥
  36. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 2. αʔϏεσΟεΧόϦʢEurekaʣͷಋೖ 37 Eureka
 Server ItemAccessor
 (Client) ItemController
 (Server) ᶄhttp://item-service/
 ɹΛ໰͍ձΘͤ
  37. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 2. αʔϏεσΟεΧόϦʢEurekaʣͷಋೖ 38 Eureka
 Server ItemAccessor
 (Client) ItemController
 (Server) ᶅItemServiceͷ
 ɹϗετ໊ͱ
 ɹϙʔτ൪߸Λ
 ɹฦ͢ʢෳ਺Մʣ
  38. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 2. αʔϏεσΟεΧόϦʢEurekaʣͷಋೖ 39 Eureka
 Server ItemAccessor
 (Client) ItemController
 (Server) ᶆड͚औͬͨ৘ใͰ
 ɹΞΫηε
  39. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 2. αʔϏεσΟεΧόϦʢEurekaʣͷಋೖ • αʔϏεΛʮԿ୆ʯʮͲͷαʔόͰʯ
 ʮͲͷϙʔτͰʯىಈͯ͠΋ྑ͍
 ɹˠ εέʔϧͷࣗ༝Խ • Spring Boot + Spring CloudΛ࢖͏͜ͱͰ
 ਺ߦͷઃఆ͚ͩͰར༻Մʢʂʣ 40
  40. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 3. JUnitͷൣғΛ໌֬Խ • ControllerҎ߱ͷςετʢJUnitʣ • αʔϏεͷػೳ୯ମςετ • αʔϏε୯ମͰͷend-to-endͷςετʢJUnit) • Spring BootͳΒJUnitͰ؆୯ʹͰ͖Δ • ओʹม׵ͱόϦσʔγϣϯͷࢼݧ • ֎෦αʔϏεݺͼग़͠෦෼͸ϞοΫԽ 41
  41. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 3. JUnitͷൣғΛ໌֬Խ • ෳ਺αʔϏεͷςετʢJUnitʣ • ֎෦αʔϏε͸௚઀ݺͼग़͢ 42
  42. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ 43 ItemService
 (interface) ItemAccessor
 (Client) ItemController
 (Server) HTTP
 AMQP implements implements LogicΫϥε
  43. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ 44 TestCase ItemController
 (Server) LogicΫϥε ᶃΠϯελϯε
 ɹ࡞੒ ᶄItemServiceͷϞοΫͱͯ͠DI
  44. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ 45 TestCase ItemController
 (Server) LogicΫϥε ᶅ௚઀ݺͼग़͢
  45. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ޻෉ͨ͜͠ͱ 4. σϓϩΠͷࣗಈԽ • ܰ͘࡞͚ͬͨͩͰ΋ɺे਺ͷαʔϏε͕͋ΔͷͰ
 σϓϩΠͷࣗಈԽ͸ඞਢ • ansibleΛར༻ʢchef͸࠳ંɾɾɾʣ • AWSͰ࢖͍ͬͯΔҎ্͸docker͸
 ͦΜͳʹϝϦοτ͕ͳ͍ͱࢥ͍ͬͯΔ 46
  46. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ྑ͔ͬͨ͜ͱ 1. ࣗ༝ͳεέʔϧΠϯɺεέʔϧΞ΢τ͕Ͱ͖ɺ
 ϩʔυόϥϯγϯά·ͰͰ͖ΔΑ͏ʹͳͬͨɻ 2. αʔϏεͷϗετ໊΍ϙʔτ൪߸Λ
 શ͘؅ཧ͠ͳͯ͘ྑ͘ͳͬͨ 3. ಉظɺඇಉظͷ։ൃͱςετͷ
 ඪ४తͳ΍Γํ͕ܾ·ͬͨ 47
  47. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ࣦഊͨ͜͠ͱ 48
  48. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ࣦഊͨ͜͠ͱ ಛʹͳ͠
 → ׬શʹϚΠΫϩαʔϏεΛϚελʔͨ͠ײ☺️ 49
  49. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 3. ϚΠΫϩαʔϏετϥΠΞϧୈҰ஄ ࣦഊͨ͜͠ͱ ಛʹͳ͠
 → ׬શʹϚΠΫϩαʔϏεΛϚελʔͨ͠ײ☺️
 ɾɾɾͱࢥͬͨΒɺ࣍ͷ։ൃͷ࣌ʹ͸
 ࠓճ࡞ͬͨϚΠΫϩαʔϏε͕
 Ζ͘ʹ࠶ར༻Ͱ͖ͳ͔ͬͨ 50
  50. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 51 #4 ϚΠΫϩαʔϏε
 τϥΠΞϧୈೋ஄
  51. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 4. ϚΠΫϩαʔϏετϥΠΞϧୈೋ஄ ΍ͬͨ͜ͱ 1. ؅ཧը໘ͷϚΠΫϩαʔϏεԽ • ঎඼৘ใαʔϏεɺࡏݿαʔϏεɺ
 ྉۚαʔϏεͳͲΛ࠶։ൃ 2. ٕज़ελοΫ • Spring Bootʢ1.3ܥʣ • Spring Cloud 52
  52. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 4. ϚΠΫϩαʔϏετϥΠΞϧୈೋ஄ ࠔͬͨ͜ͱ 1. ୈҰ஄Ͱ࢖͍ٕͬͯͨज़ελοΫͱͷޓ׵ੑ • ୈҰ஄ : Spring Boot 1.2 + Spring Cloud Angel • ୈೋ஄ : Spring Boot 1.3 + Spring Cloud Brixton
 ɹˠ AngelͷEurekaʹ
 ɹɹBrixtonͷαʔϏεΛొ࿥Ͱ͖ͳ͍
 ɹˠ BrixtonͷEurekaʹ
 ɹɹAngelͷαʔϏε͸ొ࿥Ͱ͖ͨ 53
  53. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 4. ϚΠΫϩαʔϏετϥΠΞϧୈೋ஄ ࠔͬͨ͜ͱ 1. ୈҰ஄Ͱ࢖͍ٕͬͯͨज़ελοΫͱͷޓ׵ੑ • pom.xmlͷੈ୅෼͚ • pom.xmlʢ਌ʣ • pom_sb12.xml • pom_sb13.xml – ϙϦάϩοτͷߟ͑ํ͸ແࢹ 54
  54. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 4. ϚΠΫϩαʔϏετϥΠΞϧୈೋ஄ ޻෉ͨ͜͠ͱ 1. ϞχλϦϯάͱΞϥʔτ • αʔόͷ୆਺΍ϓϩηε਺͕૿͑ΔͷͰ
 ؂ࢹ͕ෆՄܽ • ΍ͬͯͳ͔ͬͨΒຊ൪؀ڥͰো֐͕ɾɾɾ 55
  55. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 4. ϚΠΫϩαʔϏετϥΠΞϧୈೋ஄ ޻෉ͨ͜͠ͱ 1. ϞχλϦϯάͱΞϥʔτ • CloudWatch + ΧελϜϝτϦΫεͰऩू • Ϧιʔε৘ใʢCPUɺϝϞϦɺσΟεΫʣ • ϓϩηε৘ใʢࢮ׆ʣ • ϩά͸CloudWatch LogsͱElasticsearchʹू໿ • ϩά؂ࢹ͸CloudWatchͰ࣮ࢪ • ϩά෼ੳΛElasticsearchͰ࣮ࢪ 56
  56. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 57 #5 ϚΠΫϩαʔϏε
 τϥΠΞϧୈࡾ஄
  57. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ ΍ͬͨ͜ͱ 1. ߪೖը໘ͷϚΠΫϩαʔϏεԽ • ঎඼৘ใαʔϏεɺࡏݿαʔϏεɺ
 ྉۚαʔϏεͳͲΛ௥Ճ։ൃ 2. ٕज़ελοΫ • Spring Bootʢ1.3ܥʣ • Spring CloudʢBrixtonܥʣ • Spring Session + Hazelcastʢηογϣϯڞ༗ʣ 58
  58. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ ࠔͬͨ͜ͱ 1. վΊͯɺը໘ʹAPI͕Ҿ͖ͮΒΕΔ • ϚΠΫϩαʔϏε : ঎඼ϦετAPI • ཉ͍͠αʔϏε : ൢചՄೳͳ঎඼ϦετAPI • αʔϏε = Repository? • ͜ͷลΓͰυϝΠϯ෼ׂͷॏཁੑʹؾͮ͘ 59
  59. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ ࠔͬͨ͜ͱ 1. վΊͯɺը໘ʹAPI͕Ҿ͖ͮΒΕΔ • ϑϩϯταʔϏεʢίϯτϩʔϥαʔϏεʣͱ
 υϝΠϯαʔϏεͷ෼཭ • ϑϩϯταʔϏε͕ɺඞཁʹԠͯ͡ɺ
 υϝΠϯαʔϏεΛݺͼग़͢ 60
  60. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ ࠔͬͨ͜ͱ 1. վΊͯɺը໘ʹAPI͕Ҿ͖ͮΒΕΔ • υϝΠϯαʔϏεͷAPI͸ɺݪଇͱͯ͠ɺ
 ʮ؅ཧը໘Ͱ࢖͑Δʯ͙Β͍ͷ࠶ར༻ੑΛ࣋ͭ 61
  61. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ ࠔͬͨ͜ͱ 2. طଘॲཧʹ͋ΔڊେͳSQL͕෼ׂͰ͖ͳ͍ • ঎඼ɺࡏݿɺྉۚͷςʔϒϧͱɺ
 ͦΕͧͷؔ࿈ςʔϒϧΛ͕ͬͭΓjoinͨ͠SQL 62
  62. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 5. ϚΠΫϩαʔϏετϥΠΞϧୈࡾ஄ ࠔͬͨ͜ͱ 2. طଘॲཧʹ͋ΔڊେͳSQL͕෼ׂͰ͖ͳ͍ • গͳ͘ͱ΋ɺ঎඼ɺࡏݿɺྉۚͷɺ
 υϝΠϯ͙Β͍ʹ͸෼཭͢Δ͕ɺ
 ؔ࿈ςʔϒϧͷ੾Γ֎͠͸͍ͬͨΜఘΊͨ
 ɹˠ ͜ͷลΓ͸ղܾࡦ͕ݟ͍͑ͯͳ͍ 63
  63. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 64 #6 ࠓޙ
 औΓ૊Έ͍ͨ͜ͱ
  64. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 6. ࠓޙऔΓ૊Έ͍ͨ͜ͱ ো֐ୈҰઃܭ 1. ো֐͕ى͖ΔલఏͰॲཧΛೖΕΔ • Circuit Breakerͱ͍͏֓೦ • ୯Ґ࣌ؒ͋ͨΓͷΤϥʔճ਺͕ᮢ஋Λ௒͑ͨΒ
 ৗʹ୅ସॲཧΛߦ͏ʢҰఆ࣌ؒͰ෮ؼʣ • NetflixͷHystrixͰ༰қʹ࣮ݱͰ͖Δ 2. ͱ͸ݴ͑ɺো֐͕ى͖ͨΒͲ͏͢Δͷʁ • ௨஌͢Δ • ௨৴ΤϥʔΛฦ͢ • ઐ༻ΤϥʔΛฦ͢ • ΩϟογϡΛฦ͢ 65
  65. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 6. ࠓޙऔΓ૊Έ͍ͨ͜ͱ Ωϟογϡ 1. υϝΠϯ͝ͱʹαʔϏεΛ෼͚Ε͹
 υϝΠϯͷಛੑ͝ͱͷΩϟογϡΛ࡞੒Ͱ͖Δ • ঎඼৘ใ΍ྉۚ͸සൟʹมΘΒͳ͍͔Β
 Ωϟογϡ͕ޮ͘ • ࡏݿ͸มಈ͢Δ͔ΒΩϟογϡ͕ޮ͔ͳ͍͠
 τϥϯβΫγϣϯ͸ݫີʹ͠ͳͯ͘͸͍͚ͳ͍ 66
  66. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 6. ࠓޙऔΓ૊Έ͍ͨ͜ͱ ϙϦάϩοτ 1. GoͷΑ͏ͳϝϞϦϑοτϓϦϯτͷখ͞ͳݴޠΛ࢖͍͍ͨ 2. ෳ਺ݴޠͰهࡌ͢Δͱ͖ͷোน͸ϛυϧ΢ΣΞ • EurekaΛଞͷݴޠͰ࢖͍͍ͨ 3. ੜ࢈ੑ΁ͷӨڹ • Spring Boot + Spring Cloud΄Ͳͷ
 ੜ࢈ੑΛग़ͤΔ૊Έ߹Θͤ͸গͳ͍ • IDEͷOpen Call HierarchyͰ΍͍ͬͯͨࣄ͕
 Ͱ͖ͳ͘ͳΔ 67
  67. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 6. ࠓޙऔΓ૊Έ͍ͨ͜ͱ ΠϕϯτυϦϒϯ 1. ϦΫΤετΛΠϕϯτͱଊ͑ͯॲཧ͢Δ 2. ঢ়ଶભҠΛΠϕϯτͱଊ͑ͯॲཧ͢Δ 3. όονͳ͠ɺ͢΂ͯϦΞϧλΠϜͰॲཧ͢Δ 68
  68. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 69 #7 ຊ౰ʹ
 ϚΠΫϩαʔϏε͸
 ࠷ద͔ʁ
  69. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 7. ຊ౰ʹϚΠΫϩαʔϏε͸࠷ద͔ʁ ೔ຊͱԤถͷจԽͷҧ͍ 1. νʔϜϫʔΫͷҧ͍ • ถ : APIΛܖ໿ʹ͢ΔɻAPI͕Ͱ͖ͨΒؼ୐ɻ • ೔ : ΈΜͳͰ্ख͘ߦ͘Α͏ʹؤுΔɻ
 ɹɹશମͷͨΊʹAPIΛม͑Δ͜ͱΛ
 ɹɹ͋·ΓԀΘͳ͍ɻ 70
  70. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 7. ຊ౰ʹϚΠΫϩαʔϏε͸࠷ద͔ʁ ೔ຊͱԤถͷจԽͷҧ͍ 2. DBΞΫηεͷҧ͍ • ถ : JPAɺHibernateɺඞવతʹjoinগͳ͍ • ೔ : MyBatisɺDomaɺʢS2Daoʣ
 ɹɹ௕େͳSQL͕͋ͬͯjoin΋ଟ͍
 → ͜ͷ͍ͤͰطଘͷϞϊϦε͔Β
 ɹɹϚΠΫϩαʔϏε΁ͷҠߦ͕೉͘͠ͳΔɻ 71
  71. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 7. ຊ౰ʹϚΠΫϩαʔϏε͸࠷ద͔ʁ ೔ຊͱԤถͷจԽͷҧ͍ 3. ϚΠΫϩαʔϏε͸ʮ݁Ռ࿦ʯ • ࣗ෼ͷձࣾɺάϧʔϓɺϓϩδΣΫτʹͱͬͯ
 ద੾ͳΞʔΩςΫνϟʹͳΔΑ͏
 ࠷దԽ͢Δඞཁ͕͋Δɻ
 ڭՊॻͷ·ͶΛͯ͠΋μϝ 72
  72. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. 73 ·ͱΊ
  73. Copyright © Acroquest Technology Co., Ltd. All rights reserved. Copyright

    © Acroquest Technology Co., Ltd. All rights reserved. ·ͱΊ ϚΠΫϩαʔϏε͸݁Ռ࿦ ಉظɺඇಉظɺςετΛؚΊٕͨज़ղΛ໌֬Խ͢Δ Spring Boot + RabbitMQͰ͍·ͷͱ͜Ζ໰୊ͳ͠ ඞਢٕज़Λ೺Ѳ͢Δ αʔϏεσΟεΧόϦʢEurekaʣ εέʔϧΠϯɺΞ΢τɺLBɺσϓϩΠ σϓϩΠͷࣗಈԽʢChef / Ansibleʣ ϞχλϦϯάʢCloudWatch / Elasticsearchʣ ෼ׂཻ౓Ͱ೰ΜͩΒʮ؅ཧը໘Λ࡞ΕΔAPIʯ͕Ұͭͷ໨҆ ࣗ෼ͨͪͷ૊৫ʹ߹Θͤͨ࠷దԽ͕ඞਢ 74
  74. Copyright © Acroquest Technology Co., Ltd. All rights reserved. 75

    Enjoy your own microservices architecture!