1 Followers
26 Following
nooble

Nooble

Microservices ---Centralized Configuration with Spring Cloud

To manage each microservices separately is a very difficult and time consuming task as there are several modules and managing each module with the conventional approach. Central configuration connects with the properties of microservice.

The implementation process:

  • Setting up the configuration server project

Setting up the configuration server project is to create the spring boot application by making changes in pom.xml. For more knowledge you can follow the Spring Data JPA Tutorial.

 

  • Adjoin the spring cloud.

As the HTTP resource-based API, the spring cloud server provides external configuration. The Spring Microservices Config Server is embedded in the spring boot application.

 

  • Set up a configuration repository

The setup configuration repository is created in GitHub. The file names should be <application-name>-<profile>.yml/properties.

 

  • Mark application - properties/application.yml
  • Formulate the application with application. properties/ application.yml. Then proceed further.

 

  • Being with the configuration server

Being with spring boot application use the Github to make-sure the application is already connected to the external configuration.

 

  • For the client, the project creates a configuration server

In this procedure you have to create the spring boot application with some changes in pom.xml.

 

  • To retrieve the configuration from the server creates the rest endpoint

If the value is unable to populate use the server.url is defaulted to " Unable to connect to configuration server". In case we are able to connect the configuration server then it will respond back through web service. 

 

  • Configure the bootstrap.properties/ bootstrap.yml.

While working on Microservices Spring Data JPA, this step is to update the configuration in the client application.

 

  • Start the spring boot application.

In this step start the configuration client. This application can control the missing configuration server and you can run the above client application when the configuration server is not responding.

Features of Microservices

Multiple components

The microservices are divided into various components. You can deploy or even redeploy the components individually without affecting the application. This implies that you don't have to redeploy the whole application when you need to change the service individually. In this process you need high-level complexity, remote calls, coarser-grained remote API that turns to be expensive.

Built for business

Monolithic development is focused on particular aspects like database, UIs, server-side logic, whereas in microservices teams are formed for the functional capabilities. So, from here the team will be responsible for building the product. From here the team builds individual applications throughout its life.

Simple routing

Microservices work as per the requests is received that is exactly opposite how enterprise services buses work. The microservices process information through endpoints and apply logic to it.

Decentralized

Traditional microservices methods have a centralized option for the governance that does not work with the usage with different platforms and technologies. It needs a good number of developers who work on to develop useful tools to resolve the issues and so decentralized governance work for it. Leaving the decentralized governance apart, data management is favored by microservices architecture. Every service comes up with its own uniqueness of the database. But there is a single logical database for monolithic architecture.