Spring Cloud Config Client

The Spring Cloud Config Client is a component of the Spring Cloud framework that enables applications to access configuration properties stored in a centralized configuration server. It allows for the externalization of configurations from the application code, promoting a more maintainable and flexible architecture.

Spring Cloud Config Server is where the configurations for multiple applications are stored.

During startup, the Config Client contacts the Config Server to obtain the application-specific configuration properties. The client application uses the application name, profile and label information to fetch the relevant configuration.

To set up a Spring Cloud Config Client:

i) Add below dependency


ii) Configure the client: In application.properties or application.yml, specify the Config Server’s location, application name, profile and label.


iii) Access the configured properties in app as usual

package com.example.springconfigclientdemo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

public class SpringConfigClientController {
	String greeting;

	public String greet() {
		return greeting;

For complete source code: https://github.com/MMahendravarman/Springboot_Examples

Leave a Reply

Your email address will not be published. Required fields are marked *