Advanced Spring Boot with Consul
Speaker: Michael Gendelman @MikeGendelman
See list of all blog posts from conference
“when someone writes something clever and leaves, that’s a problem”
“every time someone logs onto a box at a Fortune 500 company, it is a big deal”
Consul
- for service discovery and configuration management
- Consul agent – does health check and forwards queries. Runs on machine of all apps
- Consul server – elects a leader. Want 3-5 per data center. Must have at least 3 so can elect leader
- Has UI – can see properties/services/etc. Can update config in UI in addition to through yml files [talked about risk of having the real properties be out of sync of the yaml. Good that devops has evolved to the point this is a common worry]
- Same executable for server and agent
Monitoring
“health of the service is more important than the health of a single instance”
Don’t need a page/alert if enough are still up
Code>
- Use spring-cloud-starter-consul-all Maven dependency – made by an independent company
- Have dev mode so can run in isolation but test all the features
- annotation to enable discovery
- Have bootstrap.yml file to set up config – instead of application.yml
thinks there is plugins/script to link version control to properties. good if need different properties in different environments
I learned enough about Spring Boot yesterday to be able to follow Mike’s example. Seeing the live demo of Consol was nice.