How to use RefreshScope with enabled bootstrap

Viewed 259

I have a Spring Boot application using Spring Cloud Config Client and I have a controller annotated by @RefreshScope annotation in the application.

At this point, refresh (POST to http://localhost:8889/actuator/refresh) worked for me.

Then, I needed to add the following dependency which (as I understand it) effectively turns on bootstrap.

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-bootstrap</artifactId>
    </dependency>

After that, when I send the refresh request the bean is not refreshed and I get the following response:

[
    "spring.cloud.bootstrap.enabled"
]

I noticed, that when bootstrap is used, bean LegacyContextRefresher is created instead of ConfigDataContextRefresher that was used before... but I didn't figure out yet how to make refresh working together with bootstrap.

Any help will be appreciated.

0 Answers
Related