Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Advanced Spring Boot with Consul

6.347 visualizaciones

Publicado el

MICHAEL GENDELMAN SYSTEMS MANAGEMENT ARCHITECT, NOMURA
Take your Spring Boot applications to the next level by utilizing configuration service, discovery service and advanced metrics and monitoring, needed to support micro services and cloud. We will add discovery and configuration services to an existing Spring Boot application and demonstrate hot configuration change and failover. We will create custom metrics and push them out to a common monitoring framework.

Publicado en: Software
  • Sé el primero en comentar

Advanced Spring Boot with Consul

  1. 1. 1 © 2016 Pivotal Advanced Spring Boot with Consul Mike Gendelman, Systems Mgmt. Architect, Nomura @MikeGendelman
  2. 2. 2 Learn More. Stay Connected. §  Reduce Complexity §  Automate Everything §  Standardization §  Adaptable Twitter: twitter.com/springcentral YouTube: spring.io/video LinkedIn: spring.io/linkedin Google Plus: spring.io/gplus
  3. 3. 3 Agenda §  Modern Software Development Challenges §  Review of Basic Spring Boot Applications §  Enhanced Spring Boot Applications with Consul §  Demo §  Next Steps
  4. 4. 4 Modern Software Development Challenges §  Development Teams •  Smaller teams •  Turnover •  Quickly changing technology §  Platform Agility •  Containers, public clouds, private clouds and hybrid •  Migration on its own does not improve the applications §  Regulatory & Compliance
  5. 5. 5 Agenda §  Modern Software Development Challenges §  Review of Basic Spring Boot Applications §  Enhanced Spring Boot Applications with Consul §  Demo §  Conclusion
  6. 6. 6 Simple Spring Boot Applications Invoice Service §  Invoice Service calls the Tax Service to calculate tax §  Location of Tax Service must be known by the Invoice Service §  Two basic Spring Boot applications Tax Service
  7. 7. 7 Standard Spring Boot Rest POM
  8. 8. 8 Standard Spring Boot Rest Application
  9. 9. 9 Standard Spring Boot Rest Controller
  10. 10. 10 Standard Spring Boot application.yml
  11. 11. 11 Agenda §  Modern Software Development Challenges §  Review of Basic Spring Boot Applications §  Enhanced Spring Boot Applications with Consul §  Demo §  Conclusion
  12. 12. 12 Consul “ Consul provides first-class support for service discovery, health checking, K/ V storage, and multiple datacenters. Consul.io
  13. 13. 13 Spring Boot with Consul Invoice Service Consul Agent Tax Service Consul Server §  Consul Agent •  Health Check •  Forward Queries §  Consul Server •  Store Data •  Respond to Queries •  Leader Election
  14. 14. 14 Spring Boot with Consul Spring Boot Application Configuration Service Registration Service Discovery Service Health Consul Spring Cloud Consul
  15. 15. 15 Advantages Monitoring Deployment Configuration •  Update at run-time •  No local configuration •  Dynamic discovery of endpoints •  Start order does not matter •  Simple deployment •  Separation of environments •  Discover services to monitor •  Health of the service is more important than the heath of a single instance
  16. 16. 16 Spring Boot Rest POM + Consul
  17. 17. 17 Spring Boot Rest Application + Consul
  18. 18. 18 Spring Boot Rest Controller + Consul
  19. 19. 19 Spring Boot Bootstrap.yml for Consul
  20. 20. 20 Calling the Tax Service restTemplate.getForObject("http://"+host + ":" + port +"/tax/{subtotal}",Double.class, subtotal ); restTemplate.getForObject("http://tax-service/tax/ {subtotal}",Double.class, subtotal ); With Consul Without Consul
  21. 21. 21 Add the Properties to Consul
  22. 22. 22 The New Service
  23. 23. 23 Setting Up Consul §  Requires at least three Consul Servers per cluster for establish quorum §  Every host must run a consul agent §  Agents are stateless and forward all request to the servers §  Same executable can be started as a server or an agent §  Recommend different clusters for production and non-production §  Development environment can be setup with a single local instance: consul agent –dev -ui
  24. 24. 24 Demo SPRING BOOT & CONSUL
  25. 25. 25 Next Steps https://github.com/mgendelman/spring-boot-consul-demo-tax.git https://github.com/mgendelman/spring-boot-consul-demo-invoice.git https://www.consul.io/ https://cloud.spring.io/spring-cloud-consul/

×