{"id":361,"date":"2019-07-22T17:54:39","date_gmt":"2019-07-22T17:54:39","guid":{"rendered":"http:\/\/www.canchito-dev.com\/public\/blog\/?p=361"},"modified":"2021-05-02T13:41:28","modified_gmt":"2021-05-02T13:41:28","slug":"spring-cloud-config-server-and-client-side-support-for-externalized-configuration","status":"publish","type":"post","link":"https:\/\/www.canchito-dev.com\/public\/blog\/2019\/07\/22\/spring-cloud-config-server-and-client-side-support-for-externalized-configuration\/","title":{"rendered":"Spring Cloud Config &#8211; Server and client-side support for externalized configuration"},"content":{"rendered":"<div class=\"perfect-pullquote vcard pullquote-align-full pullquote-border-placement-left\"><blockquote><p><\/p>\n<p style=\"text-align: justify;\">Want to learn how to manage your application configuration in a distributed environment? Learn how to do it with Spring Cloud Config.<\/p>\n<p><\/p><\/blockquote><\/div>\n<div>\n  <a class=\"donate-with-crypto\"\n     href=\"https:\/\/commerce.coinbase.com\/checkout\/faf64f90-2e80-46ee-aeba-0fde14cbeb46\"><br \/>\n    Buy Me a Coffee<br \/>\n  <\/a><br \/>\n  <script src=\"https:\/\/commerce.coinbase.com\/v1\/checkout.js?version=201807\">\n  <\/script>\n<\/div>\n<h2>Contribute Code<\/h2>\n<p style=\"text-align: justify;\">If you would like to become an active contributor to this project, please follow these simple steps:<\/p>\n<ul style=\"text-align: justify;\">\n<li>Fork it<\/li>\n<li>Create your feature branch<\/li>\n<li>Commit your changes<\/li>\n<li>Push to the branch<\/li>\n<li>Create new Pull Request<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">Source code can be downloaded from <a href=\"https:\/\/github.com\/canchito-dev\/spring-cloud-config\">github<\/a>.<\/p>\n<h2>What you\u2019ll need<\/h2>\n<ul>\n<li style=\"text-align: justify;\">About 30 minutes<\/li>\n<li style=\"text-align: justify;\">A favorite IDE or Spring Tool Suite&#x2122; already install<\/li>\n<li style=\"text-align: justify;\">JDK 6 or later<\/li>\n<\/ul>\n<h2>Introduction<\/h2>\n<p style=\"text-align: justify;\">In a distributed application environment, there can be several isolated microservices. Each one of them can have different configurations, depending on the environment in which it is running. For instance, typically, a microservice could be tested in a development environment first. Once this testing is done, it can be moved to pre-production environment, where it is tested together with other microservices. And finally, it is moved to production. In each these environments, the same microservice needs different configurations.<\/p>\n<p style=\"text-align: justify;\">One of the most challenging issues that developer face in a microservice architecture, is deciding how to maintain and manage the configuration of the microservices. This is where <strong>Spring Cloud Config<\/strong> comes very handy.<\/p>\n<p style=\"text-align: justify;\">In this article, we\u2019re going to introduce <strong>Spring Cloud Config<\/strong>, by first covering the basic and afterwards by learning how to configure both a configuration server and the clients that connect to it and use the configuration provided by the server.<\/p>\n<h2>Overview<\/h2>\n<p style=\"text-align: justify;\"><strong>Spring Boot<\/strong> is a framework aimed to help developers to easily create and build stand-alone, production-grade Spring based Applications that you can &#8220;just run&#8221;.<\/p>\n<p style=\"text-align: justify;\"><strong>Spring Cloud Config <\/strong>provides server and client-side support for externalized configuration in a distributed system. With the <strong>Spring Cloud Config Server<\/strong> you have a central place to manage external properties for applications across all environments.<\/p>\n<div id=\"attachment_363\" style=\"width: 816px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-363\" data-attachment-id=\"363\" data-permalink=\"https:\/\/www.canchito-dev.com\/public\/blog\/2019\/07\/22\/spring-cloud-config-server-and-client-side-support-for-externalized-configuration\/spring-boot-config-server-and-client-side-support-for-externalized-configuration\/\" data-orig-file=\"https:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-side-support-for-externalized-configuration.png\" data-orig-size=\"806,426\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Spring Boot Config &amp;#8211; Server and client-side support for externalized configuration\" data-image-description=\"&lt;p&gt;CANCHITO-DEV: Spring Boot Config &amp;#8211; Server and client-side support for externalized configuration&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;CANCHITO-DEV: Spring Boot Config &amp;#8211; Server and client-side support for externalized configuration&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-side-support-for-externalized-configuration.png\" class=\"size-full wp-image-363\" src=\"http:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-side-support-for-externalized-configuration.png\" alt=\"CANCHITO-DEV: Spring Boot Config - Server and client-side support for externalized configuration\" width=\"806\" height=\"426\" srcset=\"https:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-side-support-for-externalized-configuration.png 806w, https:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-side-support-for-externalized-configuration-300x159.png 300w, https:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-side-support-for-externalized-configuration-768x406.png 768w, https:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-side-support-for-externalized-configuration-624x330.png 624w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><p id=\"caption-attachment-363\" class=\"wp-caption-text\">CANCHITO-DEV: Spring Boot Config &#8211; Server and client-side support for externalized configuration<\/p><\/div>\n<p style=\"text-align: justify;\"><strong>Spring Cloud Config Server<\/strong> is a centralized service that via HTTP provides all the applications configuration (name-value pairs or equivalent YAML content). The server is embeddable in a <strong>Spring Boot<\/strong> application, by using the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">@EnableConfigServer<\/code> annotation.<\/p>\n<p style=\"text-align: justify;\">In other words, the <strong>Spring Cloud Config Server<\/strong> is simply a <strong>Spring Boot<\/strong> application, configured as a <strong>Spring Cloud Config Server<\/strong>, and that is able to retrieve the properties from the configured property source. The property source can be a <strong>Git repository<\/strong>, <strong>svn<\/strong> or <strong>Consul service<\/strong>.\u00a0 In this article, we will use file-based Git repository as a property source.<\/p>\n<p style=\"text-align: justify;\">A <strong>Spring Boot<\/strong> application properly configured, can take immediate advantage of the <strong>Spring Config Server<\/strong>. It also picks up some additional useful features related to <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">Environment<\/code> change events. Any <strong>Spring Boot<\/strong> application can easily be configured as a <strong>Spring Cloud Config Client<\/strong>.<\/p>\n<h2>Explaining the demo<\/h2>\n<p style=\"text-align: justify;\">The below image explains the application architecture that we will be creating in this article.<\/p>\n<div id=\"attachment_362\" style=\"width: 816px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-362\" data-attachment-id=\"362\" data-permalink=\"https:\/\/www.canchito-dev.com\/public\/blog\/2019\/07\/22\/spring-cloud-config-server-and-client-side-support-for-externalized-configuration\/spring-boot-config-server-and-client-demo\/\" data-orig-file=\"https:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-demo.png\" data-orig-size=\"806,322\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Spring Boot Config &amp;#8211; Server and client demo\" data-image-description=\"&lt;p&gt;CANCHITO-DEV: Spring Boot Config &amp;#8211; Server and client demo&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;CANCHITO-DEV: Spring Boot Config &amp;#8211; Server and client demo&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-demo.png\" class=\"size-full wp-image-362\" src=\"http:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-demo.png\" alt=\"CANCHITO-DEV: Spring Boot Config - Server and client demo\" width=\"806\" height=\"322\" srcset=\"https:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-demo.png 806w, https:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-demo-300x120.png 300w, https:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-demo-768x307.png 768w, https:\/\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2019\/07\/Spring-Boot-Config-Server-and-client-demo-624x249.png 624w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><p id=\"caption-attachment-362\" class=\"wp-caption-text\">CANCHITO-DEV: Spring Boot Config &#8211; Server and client demo<\/p><\/div>\n<ol>\n<li style=\"text-align: justify;\"><strong>Demo App<\/strong> requests the properties from the Spring Cloud Config Server.<\/li>\n<li style=\"text-align: justify;\"><strong>Spring Cloud Config Server<\/strong> access the configuration found in the file-based <strong>Git repository<\/strong>.<\/li>\n<li style=\"text-align: justify;\">It will retrieve two properties files:\n<ol>\n<li><em>properties<\/em><em>:<\/em> It has the shared properties used by every app requesting the properties to this configuration server.<\/li>\n<li><em>spring-cloud-config.properties<\/em><em>: <\/em>App specific properties.<\/li>\n<\/ol>\n<\/li>\n<li style=\"text-align: justify;\"><strong>Demo app<\/strong> receives the latest version of the properties and uses them.<\/li>\n<li style=\"text-align: justify;\">A user modifies either the shared-, or the app specific- properties, or maybe both.<\/li>\n<li style=\"text-align: justify;\">User commands <strong>Demo App<\/strong> to refresh its properties by calling the endpoint <code class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">actuator\/refresh<\/code>.<\/li>\n<\/ol>\n<h2>File-based Git Repository<\/h2>\n<p style=\"text-align: justify;\">Let\u2019s start by creating a local file-based repository. You can create one easily by making a new directory and git committing properties and YAML files to it.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">$ cd $HOME\r\n$ mkdir config-repo\r\n$ cd config-repo\r\n$ git init .\r\n$ echo canchitodev.service-name=Spring Cloud Config Example &gt; spring-cloud-config.properties\r\n$ git add -A .\r\n$ git commit -m \"Add spring-cloud-config.properties\"<\/pre>\n<p style=\"text-align: justify;\">Using the local filesystem for your git repository is intended for testing only. You should use a server to host your configuration repositories in production.<\/p>\n<p style=\"text-align: justify;\">Anyway, once you have created it, you can go to its location, and continue modifying the <em>spring-cloud-config.properties<\/em> properties file with the help of your favorite editor. It should look something like the below example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># ----------------------------------------\r\n# EMBEDDED SERVER CONFIGURATION (ServerProperties)\r\n# server.servlet.application-display-name = Display name of the application.\r\n# server.servlet.context-path = Context path of the application.\r\n# server.port = Server HTTP port.\r\n# ----------------------------------------\r\nserver.servlet.application-display-name=Demo Spring Cloud Config\r\nserver.servlet.context-path=\/spring-cloud-config-rest\r\nserver.port=9876\r\n\r\n# ----------------------------------------\r\n# ACTUATOR PROPERTIES\r\n# ----------------------------------------\r\n# ----------------------------------------\r\n# MANAGEMENT HTTP SERVER (ManagementServerProperties)\r\n# management.server.servlet.context-path = Management endpoint context-path (for instance, `\/management`). Requires a custom management.server.port.\r\n# management.server.port = Management endpoint HTTP port. Uses the same port as the application by default. Configure a different port to use management-specific SSL.\r\n# ----------------------------------------\r\nmanagement.server.servlet.context-path=\/spring-cloud-config-actuator\r\nmanagement.server.port=9877\r\n\r\n# ----------------------------------------\r\n# DEMO SPECIFIC PROPERTIES\r\n# ----------------------------------------\r\ncanchitodev.service-name=Spring Cloud Config Example<\/pre>\n<p style=\"text-align: justify;\">Afterwards, create another properties files, and call it <em>application.properties<\/em>. This file will have all the properties that are shared among all the microservices that will be retrieving their properties from the <strong>Spring Cloud Config Server<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># ----------------------------------------\r\n# EMBEDDED SERVER CONFIGURATION (ServerProperties)\r\n# server.address = Network address to which the server should bind to.\r\n# server.connection-timeout = Time in milliseconds that connectors will wait for another HTTP request before closing the connection. When not set, the connector's container-specific default will be used. Use a value of -1 to indicate no (i.e. infinite) timeout.\r\n# server.tomcat.max-connections = Maximum number of connections that the server will accept and process at any given time.\r\n# server.tomcat.max-threads = Maximum amount of worker threads.\r\n# server.tomcat.uri-encoding = Character encoding to use to decode the URI.\r\n# ----------------------------------------\r\nserver.address=localhost\r\nserver.connection-timeout=60000\r\nserver.tomcat.max-connections=100\r\nserver.tomcat.max-threads=100\r\nserver.tomcat.uri-encoding=UTF-8\r\n\r\n# ----------------------------------------\r\n# JPA (JpaBaseConfiguration, HibernateJpaAutoConfiguration)\r\n# spring.jpa.show-sql\t= Enable logging of SQL statements.\r\n# ----------------------------------------\r\nspring.jpa.show-sql=false\r\n\r\n# ----------------------------------------\r\n# ACTUATOR PROPERTIES\r\n# ----------------------------------------\r\n# ----------------------------------------\r\n# MANAGEMENT HTTP SERVER (ManagementServerProperties)\r\n# management.server.address = Network address that the management endpoints should bind to.\r\n# ----------------------------------------\r\nmanagement.server.address=localhost\r\n\r\n# ----------------------------------------\r\n# ENDPOINTS GENERAL CONFIGURATION\r\n# management.endpoints.enabled-by-default= Whether to enable or disable all endpoints by default.\r\n# ----------------------------------------\r\nmanagement.endpoints.enabled-by-default=true\r\n\r\n# ----------------------------------------\r\n# ENDPOINTS WEB CONFIGURATION (WebEndpointProperties)\r\n# management.endpoints.web.exposure.include\t= Endpoint IDs that should be included or '*' for all.\r\n# management.endpoints.web.exposure.exclude\t= Endpoint IDs that should be excluded.\r\n# management.endpoints.web.base-path\t\t= Base path for Web endpoints. Relative to server.servlet.context-path or management.server.servlet.context-path if management.server.port is configured. Default value is \/actuator\r\n# management.endpoints.web.path-mapping\t\t= Mapping between endpoint IDs and the path that should expose them.\r\n# ----------------------------------------management.endpoints.web.exposure.include=auditevents,health,shutdown,env,info,flowable,refresh\r\n\r\n# ----------------------------------------\r\n# HEALTH ENDPOINT (HealthEndpoint, HealthEndpointProperties)\r\n# management.endpoint.health.show-details = When to show full health details. Default value is never\r\n# ----------------------------------------\r\nmanagement.endpoint.health.show-details=always\r\n\r\n# ----------------------------------------\r\n# HEALTH INDICATORS\r\n# management.health.db.enabled = Whether to enable database health check. Default value is true\r\n# management.health.defaults.enabled\t= Whether to enable default health indicators. Default value is true\r\n# management.health.diskspace.enabled = Whether to enable disk space health check. Default value is true\r\n# management.health.diskspace.path = Path used to compute the available disk space.\r\n# management.health.diskspace.threshold = Minimum disk space, in bytes, that should be available. Default value is 0\r\n# management.health.mail.enabled = Whether to enable Mail health check. Default value is true\r\n# management.health.status.http-mapping = Mapping of health statuses to HTTP status codes. By default, registered health statuses map to sensible defaults (for example, UP maps to 200).\r\n# management.health.status.order = Comma-separated list of health statuses in order of severity. Default value is DOWN,OUT_OF_SERVICE,UP,UNKNOWN\r\n# ----------------------------------------\r\nmanagement.health.defaults.enabled=true\r\nmanagement.health.diskspace.enabled=true\r\nmanagement.health.diskspace.path=C:\\\\\r\nmanagement.health.diskspace.threshold=0\r\nmanagement.health.mail.enabled=true\r\nmanagement.health.status.order=UP,DOWN,OUT_OF_SERVICE,UNKNOWN<\/pre>\n<p style=\"text-align: justify;\">We have included the sample properties files in the resources folder of the config server project.<\/p>\n<h2>Creating the Project with Maven<\/h2>\n<p style=\"text-align: justify;\">To start with, let&#8217;s create the directory structure as follow:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">spring-cloud-config\r\n\u2514\u2500\u2500 cloud-config-client\r\n    \u2514\u2500\u2500 src\r\n        \u2514\u2500\u2500 main\r\n            \u2514\u2500\u2500 java\r\n            \u2514\u2500\u2500 resources\r\n\u2514\u2500\u2500 cloud-config-server\r\n    \u2514\u2500\u2500 src\r\n        \u2514\u2500\u2500 main\r\n            \u2514\u2500\u2500 java\r\n            \u2514\u2500\u2500 resources<\/pre>\n<p style=\"text-align: justify;\">To get you started quickly, here are the complete configurations for the server and client applications:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">cloud-config-server\/pom.xml<\/code><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;project xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\" xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"\r\n    xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"&gt;\r\n  &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n\r\n  &lt;parent&gt;\r\n    &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;spring-boot-starter-parent&lt;\/artifactId&gt;\r\n    &lt;version&gt;2.1.6.RELEASE&lt;\/version&gt;\r\n    &lt;relativePath\/&gt; &lt;!-- lookup parent from repository --&gt;\r\n  &lt;\/parent&gt;\r\n  \r\n  &lt;groupId&gt;com.canchitodev.spring.projects&lt;\/groupId&gt;\r\n  &lt;artifactId&gt;cloud-config-server&lt;\/artifactId&gt;\r\n  &lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\r\n  &lt;packaging&gt;war&lt;\/packaging&gt;\r\n  \r\n  &lt;name&gt;cloud-config-server&lt;\/name&gt;\r\n  &lt;description&gt;Demo project for Spring Boot using Spring Cloud Config Server&lt;\/description&gt;\r\n  \r\n  &lt;url&gt;http:\/\/www.canchito-dev.com\/public\/blog\/2019\/07\/19\/spring-cloud-config-server-and-client-side-support-for-externalized-configuration\/&lt;\/url&gt;\r\n  \r\n  &lt;issueManagement&gt;\r\n    &lt;url&gt;https:\/\/github.com\/canchito-dev\/spring-cloud-config\/issues&lt;\/url&gt;\r\n    &lt;system&gt;Canchito Development&lt;\/system&gt;\r\n  &lt;\/issueManagement&gt;\r\n  \r\n  &lt;organization&gt;\r\n    &lt;name&gt;Canchito Development&lt;\/name&gt;\r\n    &lt;url&gt;http:\/\/www.canchito-dev.com&lt;\/url&gt;\r\n  &lt;\/organization&gt;\r\n\r\n  &lt;properties&gt;\r\n    &lt;java.version&gt;1.8&lt;\/java.version&gt;\r\n    &lt;spring-cloud.version&gt;Greenwich.SR2&lt;\/spring-cloud.version&gt;\r\n  &lt;\/properties&gt;\r\n\r\n  &lt;dependencies&gt;\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt;\r\n    &lt;\/dependency&gt;\r\n    \r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-cloud-config-server&lt;\/artifactId&gt;\r\n    &lt;\/dependency&gt;\r\n\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-boot-starter-tomcat&lt;\/artifactId&gt;\r\n      &lt;scope&gt;provided&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n    \r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-boot-starter-test&lt;\/artifactId&gt;\r\n      &lt;scope&gt;test&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n  &lt;\/dependencies&gt;\r\n\r\n  &lt;dependencyManagement&gt;\r\n    &lt;dependencies&gt;\r\n      &lt;dependency&gt;\r\n        &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;spring-cloud-dependencies&lt;\/artifactId&gt;\r\n        &lt;version&gt;${spring-cloud.version}&lt;\/version&gt;\r\n        &lt;type&gt;pom&lt;\/type&gt;\r\n        &lt;scope&gt;import&lt;\/scope&gt;\r\n      &lt;\/dependency&gt;\r\n    &lt;\/dependencies&gt;\r\n  &lt;\/dependencyManagement&gt;\r\n\r\n  &lt;build&gt;\r\n    &lt;plugins&gt;\r\n      &lt;plugin&gt;\r\n        &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt;\r\n      &lt;\/plugin&gt;\r\n    &lt;\/plugins&gt;\r\n  &lt;\/build&gt;\r\n&lt;\/project&gt;<\/pre>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">cloud-config-client\/pom.xml<\/code><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;project xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\" xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"\r\n    xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"&gt;\r\n  &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n  \r\n  &lt;parent&gt;\r\n    &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;spring-boot-starter-parent&lt;\/artifactId&gt;\r\n    &lt;version&gt;2.1.6.RELEASE&lt;\/version&gt;\r\n    &lt;relativePath\/&gt; &lt;!-- lookup parent from repository --&gt;\r\n  &lt;\/parent&gt;\r\n\r\n  &lt;groupId&gt;com.canchitodev.spring.projects&lt;\/groupId&gt;\r\n  &lt;artifactId&gt;cloud-config-client&lt;\/artifactId&gt;\r\n  &lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\r\n  &lt;packaging&gt;war&lt;\/packaging&gt;\r\n  \r\n  &lt;name&gt;cloud-config-client&lt;\/name&gt;\r\n  &lt;description&gt;Canchito-Dev demo project of a Spring Boot REST API with using Spring Cloud Config Client&lt;\/description&gt;\r\n  \r\n  &lt;url&gt;http:\/\/www.canchito-dev.com\/public\/blog\/2019\/07\/19\/spring-cloud-config-server-and-client-side-support-for-externalized-configuration\/&lt;\/url&gt;\r\n  \r\n  &lt;issueManagement&gt;\r\n    &lt;url&gt;https:\/\/github.com\/canchito-dev\/spring-cloud-config\/issues&lt;\/url&gt;\r\n    &lt;system&gt;Canchito Development&lt;\/system&gt;\r\n  &lt;\/issueManagement&gt;\r\n  \r\n  &lt;organization&gt;\r\n    &lt;name&gt;Canchito Development&lt;\/name&gt;\r\n    &lt;url&gt;http:\/\/www.canchito-dev.com&lt;\/url&gt;\r\n  &lt;\/organization&gt;\r\n\r\n  &lt;properties&gt;\r\n    &lt;java.version&gt;1.8&lt;\/java.version&gt;\r\n    &lt;spring-cloud.version&gt;Greenwich.SR2&lt;\/spring-cloud.version&gt;\r\n  &lt;\/properties&gt;\r\n\r\n  &lt;dependencies&gt;\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-boot-starter-actuator&lt;\/artifactId&gt;\r\n    &lt;\/dependency&gt;\r\n    \r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;\/artifactId&gt;\r\n    &lt;\/dependency&gt;\r\n    \r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt;\r\n    &lt;\/dependency&gt;\r\n    \r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-cloud-starter-config&lt;\/artifactId&gt;\r\n    &lt;\/dependency&gt;\r\n\r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;com.h2database&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;h2&lt;\/artifactId&gt;\r\n      &lt;scope&gt;runtime&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n    \r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-boot-starter-tomcat&lt;\/artifactId&gt;\r\n      &lt;scope&gt;provided&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n    \r\n    &lt;dependency&gt;\r\n      &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n      &lt;artifactId&gt;spring-boot-starter-test&lt;\/artifactId&gt;\r\n      &lt;scope&gt;test&lt;\/scope&gt;\r\n    &lt;\/dependency&gt;\r\n  &lt;\/dependencies&gt;\r\n\r\n  &lt;dependencyManagement&gt;\r\n    &lt;dependencies&gt;\r\n      &lt;dependency&gt;\r\n        &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;spring-cloud-dependencies&lt;\/artifactId&gt;\r\n        &lt;version&gt;${spring-cloud.version}&lt;\/version&gt;\r\n        &lt;type&gt;pom&lt;\/type&gt;\r\n        &lt;scope&gt;import&lt;\/scope&gt;\r\n      &lt;\/dependency&gt;\r\n    &lt;\/dependencies&gt;\r\n  &lt;\/dependencyManagement&gt;\r\n\r\n  &lt;build&gt;\r\n    &lt;plugins&gt;\r\n      &lt;plugin&gt;\r\n        &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt;\r\n      &lt;\/plugin&gt;\r\n    &lt;\/plugins&gt;\r\n  &lt;\/build&gt;\r\n&lt;\/project&gt;<\/pre>\n<h2>Spring Cloud Config Server Implementation<\/h2>\n<p style=\"text-align: justify;\">Let\u2019s now move on to the definition the config server. As we have said, any <strong>Spring Boot<\/strong> application can be configured as a configuration server.<\/p>\n<p style=\"text-align: justify;\">Under <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">cloud-config-server\/src\/main\/java\/<\/code>, create the package <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">com.canchitodev.cloud.config.server<\/code>. Here we create the class <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">CloudConfigServer<\/code>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">package com.canchitodev.cloud.config.server;\r\n\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\nimport org.springframework.cloud.config.server.EnableConfigServer;\r\n\r\n@EnableConfigServer\r\n@SpringBootApplication\r\npublic class CloudConfigServer {\r\n\r\n  public static void main(String[] args) {\r\n    SpringApplication.run(CloudConfigServer.class, args);\r\n  }\r\n}<\/pre>\n<p style=\"text-align: justify;\">Following, we need to tell the config server from which repository it will be retrieving the properties. We have already created a file-based local <strong>Git<\/strong> repository. And if you recall, we added a property <code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">canchitodev.service-name<\/code>.<\/p>\n<p style=\"text-align: justify;\">Add the <em>spring-cloud-config.properties<\/em> properties file under <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">cloud-config-server\/src\/main\/resources\/<\/code>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># ----------------------------------------\r\n# WEB PROPERTIES\r\n# ----------------------------------------\r\n# ----------------------------------------\r\n# EMBEDDED SERVER CONFIGURATION (ServerProperties)\r\n# server.port\t= Server HTTP port. Default is 8080\r\n# ---------------------------------------- \r\nserver.port=8888\r\n\r\n# spring.cloud.config.server.git.uri\t= URI of remote repository.\r\nspring.cloud.config.server.git.uri=file:\/\/\/${user.home}\/git\/spring-cloud-config-repo<\/pre>\n<p style=\"text-align: justify;\">Specify the path to the <strong>Git<\/strong> repository by specifying the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">spring.cloud.config.server.git.uri<\/code> property. Make sure to also specify a different <code class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">server.port<\/code> value to avoid port conflicts when you run both this server and another <strong>Spring Boot<\/strong> application on the same machine.<\/p>\n<h2>Testing Spring Cloud Config Server<\/h2>\n<p style=\"text-align: justify;\">First, start the server, as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">$ cd cloud-config-server\r\n$ mvnw spring-boot:run<\/pre>\n<p style=\"text-align: justify;\">The server is a <strong>Spring Boot<\/strong> application, so you can run it from your <strong>IDE<\/strong> if you prefer to do so (the main class is <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">CloudConfigServer<\/code>).<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">_[2m2019-07-21 15:36:56.933_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mtrationDelegate$BeanPostProcessorChecker_[0;39m _[2m:_[0;39m Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$a68ae6f4] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)\r\n\r\n  .   ____          _            __ _ _\r\n \/\\\\ \/ ___'_ __ _ _(_)_ __  __ _ \\ \\ \\ \\\r\n( ( )\\___ | '_ | '_| | '_ \\\/ _` | \\ \\ \\ \\\r\n \\\\\/  ___)| |_)| | | | | || (_| |  ) ) ) )\r\n  '  |____| .__|_| |_|_| |_\\__, | \/ \/ \/ \/\r\n =========|_|==============|___\/=\/_\/_\/_\/\r\n_[32m :: Spring Boot :: _[39m      _[2m (v2.1.6.RELEASE)_[0;39m\r\n\r\n_[2m2019-07-21 15:36:57.418_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mc.c.c.config.server.CloudConfigServer   _[0;39m _[2m:_[0;39m No active profile set, falling back to default profiles: default\r\n_[2m2019-07-21 15:36:58.480_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.cloud.context.scope.GenericScope    _[0;39m _[2m:_[0;39m BeanFactory id=624aabd2-b8a6-3b40-b5c5-d9170132d688\r\n_[2m2019-07-21 15:36:58.512_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mtrationDelegate$BeanPostProcessorChecker_[0;39m _[2m:_[0;39m Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$a68ae6f4] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)\r\n_[2m2019-07-21 15:36:58.741_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.b.w.embedded.tomcat.TomcatWebServer _[0;39m _[2m:_[0;39m Tomcat initialized with port(s): 8888 (http)\r\n_[2m2019-07-21 15:36:58.764_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.apache.catalina.core.StandardService  _[0;39m _[2m:_[0;39m Starting service [Tomcat]\r\n_[2m2019-07-21 15:36:58.765_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36morg.apache.catalina.core.StandardEngine _[0;39m _[2m:_[0;39m Starting Servlet engine: [Apache Tomcat\/9.0.21]\r\n_[2m2019-07-21 15:36:58.954_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.a.c.c.C.[Tomcat].[localhost].[\/]      _[0;39m _[2m:_[0;39m Initializing Spring embedded WebApplicationContext\r\n_[2m2019-07-21 15:36:58.954_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.web.context.ContextLoader           _[0;39m _[2m:_[0;39m Root WebApplicationContext: initialization completed in 1524 ms\r\n_[2m2019-07-21 15:36:59.888_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.s.concurrent.ThreadPoolTaskExecutor _[0;39m _[2m:_[0;39m Initializing ExecutorService 'applicationTaskExecutor'\r\n_[2m2019-07-21 15:37:00.771_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.b.a.e.web.EndpointLinksResolver     _[0;39m _[2m:_[0;39m Exposing 2 endpoint(s) beneath base path '\/actuator'\r\n_[2m2019-07-21 15:37:00.887_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.b.w.embedded.tomcat.TomcatWebServer _[0;39m _[2m:_[0;39m Tomcat started on port(s): 8888 (http) with context path ''\r\n_[2m2019-07-21 15:37:00.890_[0;39m _[32m INFO_[0;39m _[35m10292_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mc.c.c.config.server.CloudConfigServer   _[0;39m _[2m:_[0;39m Started CloudConfigServer in 5.331 seconds (JVM running for 6.561)<\/pre>\n<p style=\"text-align: justify;\">Next try out the server with the help of <a href=\"https:\/\/curl.haxx.se\/\">curl<\/a> or <a href=\"https:\/\/www.getpostman.com\/\">Postman<\/a>:<\/p>\n<p><strong><code class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">GET<\/code><\/strong><code class=\"EnlighterJSRAW\" data-enlighter-language=\"html\"> http:\/\/localhost:8888\/spring-cloud-config\/default<\/code><\/p>\n<p style=\"text-align: justify;\">In the response body you should see something like this:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\">{\r\n    \"name\": \"spring-cloud-config\",\r\n    \"profiles\": [\r\n        \"default\"\r\n    ],\r\n    \"label\": null,\r\n    \"version\": \"71ca4e5bcbab0a79b45d72251e4d8805cfdc9cc4\",\r\n    \"state\": null,\r\n    \"propertySources\": [\r\n        {\r\n            \"name\": \"file:\/\/\/C:\\\\Users\\\\josec\/git\/spring-cloud-config-repo\/spring-cloud-config.properties\",\r\n            \"source\": {\r\n                \"server.servlet.application-display-name\": \"Demo Spring Cloud Config\",\r\n                \"server.servlet.context-path\": \"\/spring-cloud-config-rest\",\r\n                \"server.port\": \"9876\",\r\n                \"management.server.servlet.context-path\": \"\/spring-cloud-config-actuator\",\r\n                \"management.server.port\": \"9877\",\r\n                \"canchitodev.service-name\": \"Spring Cloud Config Example\"\r\n            }\r\n        },\r\n        {\r\n            \"name\": \"file:\/\/\/C:\\\\Users\\\\josec\/git\/spring-cloud-config-repo\/application.properties\",\r\n            \"source\": {\r\n                \"server.address\": \"localhost\",\r\n                \"server.connection-timeout\": \"60000\",\r\n                \"server.tomcat.max-connections\": \"100\",\r\n                \"server.tomcat.max-threads\": \"100\",\r\n                \"server.tomcat.uri-encoding\": \"UTF-8\",\r\n                \"spring.jpa.show-sql\": \"false\",\r\n                \"management.server.address\": \"localhost\",\r\n                \"management.endpoints.enabled-by-default\": \"true\",\r\n                \"management.endpoints.web.exposure.include\": \"auditevents,health,shutdown,env,info,flowable,refresh\",\r\n                \"management.endpoint.health.show-details\": \"always\",\r\n                \"management.health.defaults.enabled\": \"true\",\r\n                \"management.health.diskspace.enabled\": \"true\",\r\n                \"management.health.diskspace.path\": \"C:\\\\\",\r\n                \"management.health.diskspace.threshold\": \"0\",\r\n                \"management.health.mail.enabled\": \"true\",\r\n                \"management.health.status.order\": \"UP,DOWN,OUT_OF_SERVICE,UNKNOWN\"\r\n            }\r\n        }\r\n    ]\r\n}<\/pre>\n<p style=\"text-align: justify;\">As you can see, the response body brings two properties files (<em>spring-cloud-config.properties<\/em> and <em>application.properties<\/em>). If you have another <em>application.properties<\/em> properties file defined in your client application, it will override the properties returned by the <strong>Spring Cloud Config Server<\/strong>.<\/p>\n<p style=\"text-align: justify;\">The HTTP service has resources in the following form:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/{application}\/{profile}[\/{label}]\r\n\/{application}-{profile}.yml\r\n\/{label}\/{application}-{profile}.yml\r\n\/{application}-{profile}.properties\r\n\/{label}\/{application}-{profile}.properties<\/pre>\n<p style=\"text-align: justify;\">In which the <em>{label}<\/em> placeholder refers to a <strong>Git<\/strong> branch, <em>{application}<\/em> to the client\u2019s application name and the <em>{profile}<\/em> to the client\u2019s current active application profile.<\/p>\n<p style=\"text-align: justify;\">That\u2019s it. We are done with the server implementation. Let\u2019s move on to the client implementation.<\/p>\n<h2>Spring Cloud Config Client Implementation<\/h2>\n<p style=\"text-align: justify;\">Let\u2019s now move on to the definition the client application. This will be a very simple one, consisting of a REST controller with one <em>GET<\/em> method.<\/p>\n<p style=\"text-align: justify;\">The properties to configure the client application, must be read before the rest of the application\u2019s configuration is read from the <strong>Config Server<\/strong>, during the bootstrap phase. Under <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">cloud-config-client\/src\/main\/resources\/<\/code>, we will add the <em>bootstrap.yml<\/em> file.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># ----------------------------------------\r\n# spring.application.name = Application name\r\n# spring.cloud.config.uri = The URI of the remote server (default http:\/\/localhost:8888).\r\n# spring.cloud.config.fail-fast = Flag to indicate that failure to connect to the server is fatal (default false). \r\n# ----------------------------------------\r\n\r\nspring:\r\n  application:\r\n    name: spring-cloud-config\r\n\r\n  cloud:\r\n    config:\r\n      uri: http:\/\/localhost:8888\r\n      fail-fast: true<\/pre>\n<p style=\"text-align: justify;\">In is important to notice, that we have specified the application name and the URI of the configuration server. Without them, the client application does not know how to communicate with the server, and the server does not know which properties files to retrieve.<\/p>\n<p style=\"text-align: justify;\">It is important to also enable actuator\u2019s <code class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">\/refresh<\/code> endpoint. We already enable it in the shared <em>application.properties<\/em> file. Without this endpoint, we will not be able to tell the client application to request the properties again.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">management.endpoints.web.exposure.include=auditevents,health,shutdown,env,info,flowable,refresh<\/pre>\n<p style=\"text-align: justify;\">Now, under <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">cloud-config-client\/src\/main\/java\/<\/code>, create the package <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">com.canchitodev.cloud.config.client<\/code>. Here we create the class <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">CloudConfigClient<\/code>. Right below this class, we will create the REST controller class. We will call it <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">ServiceRestController<\/code>. Notice <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">@RefreshScope<\/code> annotation. This is the annotation that tells the client application that in this class, there are properties that need to be reloaded whenever the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">\/refresh<\/code> endpoint is called.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">package com.canchitodev.cloud.config.client;\r\n\r\nimport org.springframework.beans.factory.annotation.Value;\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\nimport org.springframework.cloud.context.config.annotation.RefreshScope;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RestController;\r\n\r\n@SpringBootApplication\r\npublic class CloudConfigClient {\r\n\r\n  public static void main(String[] args) {\r\n    SpringApplication.run(CloudConfigClient.class, args);\r\n  }\r\n\r\n}\r\n\r\n@RefreshScope\r\n@RestController\r\nclass ServiceRestController {\r\n\r\n    @Value(\"${canchitodev.service-name:Service Name}\")\r\n    private String service;\r\n\r\n    @RequestMapping(\"\/service\")\r\n    String getService() {\r\n        return this.service;\r\n    }\r\n}<\/pre>\n<h2>End-to-End Testing<\/h2>\n<p>First, start the client, as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">$ cd cloud-config-client\r\n$ mvnw spring-boot:run<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">_[2m2019-07-21 21:24:36.562_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mtrationDelegate$BeanPostProcessorChecker_[0;39m _[2m:_[0;39m Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$cc1ef749] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)\r\n\r\n  .   ____          _            __ _ _\r\n \/\\\\ \/ ___'_ __ _ _(_)_ __  __ _ \\ \\ \\ \\\r\n( ( )\\___ | '_ | '_| | '_ \\\/ _` | \\ \\ \\ \\\r\n \\\\\/  ___)| |_)| | | | | || (_| |  ) ) ) )\r\n  '  |____| .__|_| |_|_| |_\\__, | \/ \/ \/ \/\r\n =========|_|==============|___\/=\/_\/_\/_\/\r\n_[32m :: Spring Boot :: _[39m      _[2m (v2.1.6.RELEASE)_[0;39m\r\n\r\n_[2m2019-07-21 21:24:37.015_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mc.c.c.ConfigServicePropertySourceLocator_[0;39m _[2m:_[0;39m Fetching config from server at : http:\/\/localhost:8888\r\n_[2m2019-07-21 21:24:37.955_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mc.c.c.ConfigServicePropertySourceLocator_[0;39m _[2m:_[0;39m Located environment: name=spring-cloud-config, profiles=[default], label=null, version=71ca4e5bcbab0a79b45d72251e4d8805cfdc9cc4, state=null\r\n_[2m2019-07-21 21:24:37.956_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mb.c.PropertySourceBootstrapConfiguration_[0;39m _[2m:_[0;39m Located property source: CompositePropertySource {name='configService', propertySources=[MapPropertySource {name='configClient'}, MapPropertySource {name='file:\/\/\/C:\\Users\\josec\/git\/spring-cloud-config-repo\/spring-cloud-config.properties'}, MapPropertySource {name='file:\/\/\/C:\\Users\\josec\/git\/spring-cloud-config-repo\/application.properties'}]}\r\n_[2m2019-07-21 21:24:37.964_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mc.c.c.config.client.CloudConfigClient   _[0;39m _[2m:_[0;39m No active profile set, falling back to default profiles: default\r\n_[2m2019-07-21 21:24:38.842_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36m.s.d.r.c.RepositoryConfigurationDelegate_[0;39m _[2m:_[0;39m Bootstrapping Spring Data repositories in DEFAULT mode.\r\n_[2m2019-07-21 21:24:38.864_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36m.s.d.r.c.RepositoryConfigurationDelegate_[0;39m _[2m:_[0;39m Finished Spring Data repository scanning in 13ms. Found 0 repository interfaces.\r\n_[2m2019-07-21 21:24:39.071_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.cloud.context.scope.GenericScope    _[0;39m _[2m:_[0;39m BeanFactory id=32adeae3-60ab-3b5f-9cfd-74fd24608c13\r\n_[2m2019-07-21 21:24:39.154_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mtrationDelegate$BeanPostProcessorChecker_[0;39m _[2m:_[0;39m Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$b004f44c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)\r\n_[2m2019-07-21 21:24:39.227_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mtrationDelegate$BeanPostProcessorChecker_[0;39m _[2m:_[0;39m Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$cc1ef749] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)\r\n_[2m2019-07-21 21:24:39.481_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.b.w.embedded.tomcat.TomcatWebServer _[0;39m _[2m:_[0;39m Tomcat initialized with port(s): 9876 (http)\r\n_[2m2019-07-21 21:24:39.505_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.apache.catalina.core.StandardService  _[0;39m _[2m:_[0;39m Starting service [Tomcat]\r\n_[2m2019-07-21 21:24:39.506_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36morg.apache.catalina.core.StandardEngine _[0;39m _[2m:_[0;39m Starting Servlet engine: [Apache Tomcat\/9.0.21]\r\n_[2m2019-07-21 21:24:39.625_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36m.a.c.c.C.[.[.[\/spring-cloud-config-rest]_[0;39m _[2m:_[0;39m Initializing Spring embedded WebApplicationContext\r\n_[2m2019-07-21 21:24:39.625_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.web.context.ContextLoader           _[0;39m _[2m:_[0;39m Root WebApplicationContext: initialization completed in 1632 ms\r\n_[2m2019-07-21 21:24:40.104_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mcom.zaxxer.hikari.HikariDataSource      _[0;39m _[2m:_[0;39m HikariPool-1 - Starting...\r\n_[2m2019-07-21 21:24:40.344_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mcom.zaxxer.hikari.HikariDataSource      _[0;39m _[2m:_[0;39m HikariPool-1 - Start completed.\r\n_[2m2019-07-21 21:24:40.457_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.hibernate.jpa.internal.util.LogHelper _[0;39m _[2m:_[0;39m HHH000204: Processing PersistenceUnitInfo [\r\n  name: default\r\n  ...]\r\n_[2m2019-07-21 21:24:40.564_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36morg.hibernate.Version                   _[0;39m _[2m:_[0;39m HHH000412: Hibernate Core {5.3.10.Final}\r\n_[2m2019-07-21 21:24:40.567_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36morg.hibernate.cfg.Environment           _[0;39m _[2m:_[0;39m HHH000206: hibernate.properties not found\r\n_[2m2019-07-21 21:24:40.799_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.hibernate.annotations.common.Version  _[0;39m _[2m:_[0;39m HCANN000001: Hibernate Commons Annotations {5.0.4.Final}\r\n_[2m2019-07-21 21:24:41.083_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36morg.hibernate.dialect.Dialect           _[0;39m _[2m:_[0;39m HHH000400: Using dialect: org.hibernate.dialect.H2Dialect\r\n_[2m2019-07-21 21:24:41.515_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.h.t.schema.internal.SchemaCreatorImpl _[0;39m _[2m:_[0;39m HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@6467ddc7'\r\n_[2m2019-07-21 21:24:41.522_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mj.LocalContainerEntityManagerFactoryBean_[0;39m _[2m:_[0;39m Initialized JPA EntityManagerFactory for persistence unit 'default'\r\n_[2m2019-07-21 21:24:41.911_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.s.concurrent.ThreadPoolTaskExecutor _[0;39m _[2m:_[0;39m Initializing ExecutorService 'applicationTaskExecutor'\r\n_[2m2019-07-21 21:24:41.965_[0;39m _[33m WARN_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36maWebConfiguration$JpaWebMvcConfiguration_[0;39m _[2m:_[0;39m spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning\r\n_[2m2019-07-21 21:24:43.011_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.b.w.embedded.tomcat.TomcatWebServer _[0;39m _[2m:_[0;39m Tomcat started on port(s): 9876 (http) with context path '\/spring-cloud-config-rest'\r\n_[2m2019-07-21 21:24:43.177_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.b.w.embedded.tomcat.TomcatWebServer _[0;39m _[2m:_[0;39m Tomcat initialized with port(s): 9877 (http)\r\n_[2m2019-07-21 21:24:43.178_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.apache.catalina.core.StandardService  _[0;39m _[2m:_[0;39m Starting service [Tomcat]\r\n_[2m2019-07-21 21:24:43.179_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36morg.apache.catalina.core.StandardEngine _[0;39m _[2m:_[0;39m Starting Servlet engine: [Apache Tomcat\/9.0.21]\r\n_[2m2019-07-21 21:24:43.204_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36m.c.C.[.[.[\/spring-cloud-config-actuator]_[0;39m _[2m:_[0;39m Initializing Spring embedded WebApplicationContext\r\n_[2m2019-07-21 21:24:43.204_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.web.context.ContextLoader           _[0;39m _[2m:_[0;39m Root WebApplicationContext: initialization completed in 190 ms\r\n_[2m2019-07-21 21:24:43.251_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.b.a.e.web.EndpointLinksResolver     _[0;39m _[2m:_[0;39m Exposing 6 endpoint(s) beneath base path '\/actuator'\r\n_[2m2019-07-21 21:24:43.341_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mo.s.b.w.embedded.tomcat.TomcatWebServer _[0;39m _[2m:_[0;39m Tomcat started on port(s): 9877 (http) with context path '\/spring-cloud-config-actuator'\r\n_[2m2019-07-21 21:24:43.343_[0;39m _[32m INFO_[0;39m _[35m5876_[0;39m _[2m---_[0;39m _[2m[           main]_[0;39m _[36mc.c.c.config.client.CloudConfigClient   _[0;39m _[2m:_[0;39m Started CloudConfigClient in 7.827 seconds (JVM running for 8.588)<\/pre>\n<p style=\"text-align: justify;\">Next try out the client with the help of <a href=\"https:\/\/curl.haxx.se\/\">curl<\/a> or <a href=\"https:\/\/www.getpostman.com\/\">Postman<\/a>:<\/p>\n<p><strong>GET<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\"> http:\/\/localhost:9876\/spring-cloud-config-rest\/service<\/pre>\n<p style=\"text-align: justify;\">In the response body you should see something like this:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Spring Cloud Config Example<\/pre>\n<p style=\"text-align: justify;\">The response body corresponds to the property found in the <em>spring-cloud-config.properties<\/em> properties file.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># ----------------------------------------\r\n# DEMO SPECIFIC PROPERTIES\r\n# ----------------------------------------\r\ncanchitodev.service-name=Spring Cloud Config Example<\/pre>\n<p style=\"text-align: justify;\">Go to the repository and modify it. Once you have done that, you need to call actuator\u2019s <code class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">\/refresh<\/code> endpoint.<\/p>\n<p><strong>POST <\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">http:\/\/localhost:9877\/spring-cloud-config-actuator\/actuator\/refresh<\/pre>\n<p>The response body should look as follow:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\">[\r\n    \"canchitodev.service-name\"\r\n]<\/pre>\n<h2>Summary<\/h2>\n<p style=\"text-align: justify;\">Thanks to <strong>Spring Cloud Config<\/strong>, we are able to share, manage and handle in an easier and more convenient way, the configuration of a distributed application environment.<\/p>\n<p style=\"text-align: justify;\">We hope that, even though this was a very basic introduction, you understood how to use and configure this tool. In upcoming posts, we will be introducing <strong>Spring Cloud Bus<\/strong>. Thanks to is, we will be able to automatically refresh the properties, instead of calling the \/refresh endpoint. But this is another post &#x1f60a;.<\/p>\n<p style=\"text-align: justify;\">Please feel free to contact us. We will gladly response to any doubt or question you might have.<\/p>\n<p style=\"text-align: justify;\">The full implementation of this article can be found in the <a href=\"https:\/\/github.com\/canchito-dev\/spring-cloud-config\"><strong>GitHub<\/strong><\/a> project \u2013 this is a <strong>Maven<\/strong>-based project, so it should be easy to import and run as it is.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to learn how to manage your application configuration in a distributed environment? Learn how to do it with Spring Cloud Config.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[3,65,66],"tags":[71,13,70,67,68,69],"class_list":["post-361","post","type-post","status-publish","format-standard","hentry","category-spring","category-spring-boot","category-spring-cloud","tag-distributed-architecture","tag-java","tag-microservice","tag-spring-boot","tag-spring-cloud-config","tag-tutorial"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p8EwXo-5P","jetpack-related-posts":[{"id":263,"url":"https:\/\/www.canchito-dev.com\/public\/blog\/2018\/06\/11\/spring-boot-actuator-production-ready-features\/","url_meta":{"origin":361,"position":0},"title":"Spring Boot Actuator &#8211; Production-ready features","author":"canchitodev","date":"June 11, 2018","format":false,"excerpt":"In this post, we\u2019re going to introduce Spring Boot Actuator, by first covering the basics. Afterwards,\u00a0you will create a Spring project and learn how to use, configure and extend this monitoring tool.","rel":"","context":"In &quot;Actuator&quot;","block_context":{"text":"Actuator","link":"https:\/\/www.canchito-dev.com\/public\/blog\/category\/actuator\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27,"url":"https:\/\/www.canchito-dev.com\/public\/blog\/2017\/04\/30\/integrate-activiti-bpm-with-spring\/","url_meta":{"origin":361,"position":1},"title":"Integrate Activiti BPM with Spring","author":"canchitodev","date":"April 30, 2017","format":false,"excerpt":"In this post, you will learn how to integrate Activiti's engine and REST API into your Spring application. At the same time, you will be able to adapt the Process Engine to your needs by modifying the database connection and the Async Job Executor.","rel":"","context":"In &quot;Activiti BPM&quot;","block_context":{"text":"Activiti BPM","link":"https:\/\/www.canchito-dev.com\/public\/blog\/category\/activiti-bpm\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":471,"url":"https:\/\/www.canchito-dev.com\/public\/blog\/2020\/06\/27\/flowable-custom-engine-configuration\/","url_meta":{"origin":361,"position":2},"title":"Customizing Flowable Engine","author":"canchitodev","date":"June 27, 2020","format":false,"excerpt":"In this article, we will go into detail on how to customize Flowable's engine. Three changes to the engine will be done: (1) Change the database connection by modifying the data source and adding custom data source properties. (2)Use a strong UUID generator. (3)Implement a custom event handler.","rel":"","context":"In &quot;BPM&quot;","block_context":{"text":"BPM","link":"https:\/\/www.canchito-dev.com\/public\/blog\/category\/bpm\/"},"img":{"alt_text":"CANCHITO-DEV: Spring Initializr","src":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr-1024x674.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr-1024x674.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/initializr-1024x674.png?resize=525%2C300 1.5x"},"classes":[]},{"id":322,"url":"https:\/\/www.canchito-dev.com\/public\/blog\/2018\/09\/09\/canchito-workflow-manager-cwm\/","url_meta":{"origin":361,"position":3},"title":"Canchito Workflow Manager (CWM)","author":"canchitodev","date":"September 9, 2018","format":false,"excerpt":"Flowable BPM turned into a workflow manager with features such as file transfer via FTP and Samba, integration with Amazon Web Service, file transcodification and analysis using FFmpeg and MediaInfo, and more..","rel":"","context":"In &quot;BPM&quot;","block_context":{"text":"BPM","link":"https:\/\/www.canchito-dev.com\/public\/blog\/category\/bpm\/"},"img":{"alt_text":"CANCHITO-DEV: Task Queue Service","src":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2018\/09\/canchito_dev_task_queue_service.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":477,"url":"https:\/\/www.canchito-dev.com\/public\/blog\/2020\/06\/27\/use-flowable-apps-with-a-custom-rest-api\/","url_meta":{"origin":361,"position":4},"title":"Use Flowable Apps with a Custom REST API","author":"canchitodev","date":"June 27, 2020","format":false,"excerpt":"In this post, you will learn how configure Flowable's apps to use your custom Spring Boot REST API as a backend engine. All this, in a dockerized environment.","rel":"","context":"In &quot;BPM&quot;","block_context":{"text":"BPM","link":"https:\/\/www.canchito-dev.com\/public\/blog\/category\/bpm\/"},"img":{"alt_text":"CANCHITO-DEV: Tomcat Main","src":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/tomcat_main_page-1.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/tomcat_main_page-1.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/tomcat_main_page-1.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/05\/tomcat_main_page-1.png?resize=700%2C400 2x"},"classes":[]},{"id":499,"url":"https:\/\/www.canchito-dev.com\/public\/blog\/2020\/11\/22\/spring-security-with-saml2-and-okta\/","url_meta":{"origin":361,"position":5},"title":"Spring Security with SAML2 and Okta","author":"canchitodev","date":"November 22, 2020","format":false,"excerpt":"Greetings! In this post, we will be showing you how to build a Spring Boot application that uses Okta as platform for authentication via SAML (Security Assertion Markup Language). Ready to get started?","rel":"","context":"In &quot;Open Source&quot;","block_context":{"text":"Open Source","link":"https:\/\/www.canchito-dev.com\/public\/blog\/category\/open-source\/"},"img":{"alt_text":"CANCHITO-DEV: Okta developer console","src":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/11\/okta-developer-developer-console.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/11\/okta-developer-developer-console.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/11\/okta-developer-developer-console.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.canchito-dev.com\/public\/blog\/wp-content\/uploads\/2020\/11\/okta-developer-developer-console.png?resize=700%2C400 2x"},"classes":[]}],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/posts\/361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/comments?post=361"}],"version-history":[{"count":8,"href":"https:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/posts\/361\/revisions"}],"predecessor-version":[{"id":540,"href":"https:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/posts\/361\/revisions\/540"}],"wp:attachment":[{"href":"https:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/media?parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/categories?post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.canchito-dev.com\/public\/blog\/wp-json\/wp\/v2\/tags?post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}