Table of Contents


Spring Boot 2.4

Spring Boot 2.4 introduces a small change in Spring Cloud Config Client settings.

bootstrap.yml (or bootstrap properties) is no longer used. Previously, this file loaded before application.yml at startup and was used to read properties defined in the Cloud Config server.

In Spring Boot 2.4, configuration loading changes to spring.config.import. Now define it in application.yml as below.

spring:
  config:
    import: "optional:configserver:"

With this declaration, the client tries to connect to the Cloud Config server at http://localhost:8888 by default. If you remove prefix optional:, the client does not start when it cannot connect to the Cloud Config server.

To change server URL, set it like below. You can also use spring.cloud.config.uri, but the value set in import has higher priority.

spring:
  config:
    import: "optional:configserver:http://myconfigserver.com/"

You can also set name and profile like this. For example, if config name is “my-config” and profile is “dev”, configure as below.

spring:
  config:
    import: "optional:configserver:http://myconfigserver.com/"
  cloud:
    config:
      name: my-config
      profile: dev


Additional Reference: Spring Cloud and Spring Boot Version Mapping

Match Spring Cloud and Boot versions based on the table below.

Spring Cloud Version Spring Boot Version
2020.0.x (aka Ilford) 2.4.x
Hoxton 2.2.x, 2.3.x (and versions starting from SR5)
Greenwich 2.1.x
Finchley 2.0.x
Edgware 1.5.x
Dalston 1.5.x


Additional Reference: actuator Changes

While testing existing code for this post, Spring Cloud Bus actuator endpoints appear changed. bus-env changes to busenv, and bus-refresh changes to busrefresh.

This commit appears to include the change.