This document summarizes a presentation on Spring Cloud Config Server. It discusses managing configuration parameters in monolithic and distributed systems, expectations of managing configurations, and how Spring Cloud Config works as a centralized server. It then demonstrates creating and running a demo of Spring Cloud Config by setting up a config server and client. The demo config server reads configuration from a Git repository and the client application consumes configurations from the server.
2. Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
Punctuality
Join the session 5 minutes prior to
the session start time. We start on
time and conclude on time!
Feedback
Make sure to submit a constructive
feedback for all sessions as it is
very helpful for the presenter.
Silent Mode
Keep your mobile devices in silent
mode, feel free to move out of
session in case you need to attend
an urgent call.
Avoid Disturbance
Avoid unwanted chit chat during
the session.
3. Our Agenda
01 What is configuration Parameter?
02 What is configuration Parameter?
03 Managing in Monolith implementation
04 Managing configurations in a Distributed system
05 Expectations of managing configurations
06 Spring Cloud Config
07 Let us create a Demo
08 Let us Run the Demo
4. What is configuration Parameter?
Configuration parameters holds those values which remain unchanged during the entire life cycle of
the Application and controls the behavior and operations of the application.
In normal scenarios Database URLs, Credentials, Internationalization related values, GUI related
configurations details etc etc. can be considered as configuration parameters.
Configuration parameters can be environment specific also i.e. DEV, QA , PROD etc...
During the Design phase, it is important to define what and How for configuration parameters.
Technical Architect plays an important role here.
5. Managing in Monolith implementation
A monolithic application is self-contained and independent from other computing applications and
designed without modularity.
In adam's era configuration values were part of code either in the same code segment or in a separate
constant java class. After some evaluation, the developer community started using .properties files.
In monolith implementation, managing configuration values are not at all a challenge so keeping them
in flat file or property files or in a vault can be considered as enough good approach.
6. Managing configurations in a Distributed system
A distributed system is a collection of independent components located on different machines that
share messages with each other in order to achieve common goals.
For the approach of Microservices architecture through SpringBoot tool, we have few options so far
which we are seeing very often during development and deployments.
application.properties and application.yaml are the files that are widely used in SpringBoot to serve
configuration parameters.
Every Microservice holds its own properties and yaml file. These configurations will be holds values as
per functional need and environment need for MicroService.
Here, each and every configuration file is distributed as per location of the service.
7. Expectations of managing configurations
• It must be available throughout the life of Microservice.
• Performance and security should not be compromised.
• Must follow 12 factor App standards.
• The scope of configuration values needs to be maintained.
8. Spring Cloud Config
• It is a centralized application that manages all the application-related configuration properties.
• It is a client/server approach for storing and serving distributed configurations across multiple
applications and environments.
• Configurations are stored in either .properties file of the config Server or in a Git repository.
• Keeping configuration in Git repository is a recommended approach.
• Configuration values will be available through an endpoint URL instead of
‘org.springframework.core.env.Environment ‘ at local level.
9. Let us create a Demo
• Create a project with the help of https://start.spring.io/
10. Let us create a Demo
• ServerServiceApplication.java is the main class of this SpringBoot application.
• Annotation @EnableConfigServer will enable this application as a Config Server application.
• Contents of application.properties file.
11. Let us create a Demo
application.properties
application-dev.properties
• What is there in repo
https://github.com/Chiru7cj/config-server ?
12. Let us create a Demo
• Let us consume configurations through Config Server.
• Project dependencies should look like
this,
• Project structure should look like this,
13. Let us create a Demo
• ClientServiceApplication.java • Credentials.java • Configurations.java
• ClientServiceController.java
• application.properties