Easy Consumption of Microservices
-
Upload
spring-by-pivotal -
Category
Technology
-
view
594 -
download
0
Transcript of Easy Consumption of Microservices
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/
Easy Consumption of Microservices
Shawn SherwoodTed Tollefson
@shawn_sherwood @tedtollefson
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/2
HelloShawn SherwoodSoftware Architect – Kroger Co.20+ years development experience
Ted TollefsonSoftware Architect – Kroger Co.20+ years development experience
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/3
About Kroger Co.Quick Facts• Founded in 1883 by Bernard Kroger in Cincinnati, OH• Second-largest general retailer in the US• Ranked #17 on the Fortune 500 list• Currently operating in 35 states
• ~431,000 Employees• 2,778 Supermarkets• 784 Convenience Stores• 323 Jewelry Stores• 38 Food Production Plants
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/4
GoalMake it easy to produce and consume microservices consistently.
How are we going to do this?- Fork the Spring Initializr- Add a 3rd-party dependency- Add a VCS ignore and README- Write unit tests- Create an archetype- BONUS
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/5
Live CodeSetup
• Fork the Spring Initializr• Set up development environment• Add an “app” sub-project (for convenience)
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/6
Live CodeAdd a 3rd party dependency
Scenario: You want your project teams to encrypt sensitive values in configuration files. You want to make it as easy as possible for teams to comply.
Solution: You have found an encryption library that supports Spring Boot (jasypt-spring-boot-starter). You want to add it to your Initializr as an option.
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/7
Live CodeAdd a VCS ignore file
Scenario: Some developers keep checking in inappropriate build artifacts.
Solution: Create a standard VCS ignore file. Setup your Initializr to include the ignore file in every project that is generated.
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/8
Live CodeAdd a custom README file
Scenario: When a new project is generated, we want to capture the creation date and instructions for the libraries used.
Solution: Create a template of a README file and substitute values from the project model.
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/9
Live CodeWrite a unit test
Scenario: Your teams are want to add more capabilities to Initializr, but they keep committing changes that break it.
Solution: Use the unit test pattern included with Initializr.
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/10
Live CodeCreate a microservice archetype
Scenario: You have a standard set of microservice capabilities that you want every project team to leverage.
Solution: Create a microservice archetype in Initializr that automatically includes the libraries to support the desired capabilities.
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/11
Live CodeGenerate and Run the new microservice
Show an endpoint returning JSON
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/12
Live Code (bonus round)Add Git support
Scenario: You would like all of your project teams to be provisioned with a git repository in a standard way.
Solution: Enhance Initializr to call and configure Git. It should create a new repository and check in the newly created code.
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/13
Live Code (bonus round)Add GitHub support
Scenario: You would like all of your project teams to be provisioned with a GitHub repository in a standard way.
Solution: Enhance Initializr to call and configure GitHub. It should create a new repository and push the newly created code to GitHub.
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/14
Live Code (bonus round)Add continuous integration via Travis-CI
Scenario: You want your project teams to use continuous integration right from the start of the project. You want them to be setup in a consistent way. They should be provisioned in minutes.
Solution: Enhance Initializr to setup Travis CI. Setup a project in travis-ci.org and sync it with github.
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/15
Extending FurtherAdditional Enhancement Ideas
• More files• Dockerfile
• Application Lifecycle Management• Create a project wiki• Add issue tracking
• Environments• Provision app server, database, etc.• Create dev, test, stage and production
• Reference Architectures• Web app using Angular or React• Hybrid mobile app
Unless otherwise indicated, these s l ides are © 2013-2016 Pivota l Software , Inc . and l icensed under a Creative Commons Attr ibution-NonCommerc ia l l i cense:
http:/ /c reativecommons .org/ l icenses/by-nc/3.0/
Learn More. Stay Connected.
Fork Initializr Now!
Presentation: http://bit.ly/29V87HVCode: http://bit.ly/2au71UC
( https://github.com/ssherwood/ )
@springcentralspring.io/blog
@pivotalpivotal.io/blog
@pivotalcfhttp://engineering.pivotal.io