Describe the bug
Hey there,
So I've been playing around with native-build and I decided to give it a shoot for one of our existing projects. Everything is working fine for the default JVM build. However, when we build the app in native and start it complains that;
Exception occurred while sending email, Cause: java.lang.IllegalArgumentException: Object of class [org.springframework.context.support.GenericApplicationContext] must be an instance of interface org.springframework.context.annotation.AnnotationConfigRegistry
at org.springframework.util.Assert.instanceCheckFailed(Assert.java:713)
at org.springframework.util.Assert.isInstanceOf(Assert.java:613)
at org.springframework.util.Assert.isInstanceOf(Assert.java:644)
at org.springframework.cloud.context.named.NamedContextFactory.registerBeans(NamedContextFactory.java:143)
at org.springframework.cloud.context.named.NamedContextFactory.createContext(NamedContextFactory.java:137)
at org.springframework.cloud.context.named.NamedContextFactory.getContext(NamedContextFactory.java:122)
at org.springframework.cloud.context.named.NamedContextFactory.getInstances(NamedContextFactory.java:236)
at org.springframework.cloud.openfeign.loadbalancer.RetryableFeignBlockingLoadBalancerClient.lambda$execute$2(RetryableFeignBlockingLoadBalancerClient.java:140)
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:329)
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:225)
at org.springframework.cloud.openfeign.loadbalancer.RetryableFeignBlockingLoadBalancerClient.execute(RetryableFeignBlockingLoadBalancerClient.java:135)
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:102)
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:72)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:98)
at jdk.proxy4/jdk.proxy4.$Proxy49.sendEmail(Unknown Source)
at com.acme.foo.monitoring.common.feign.email.service.EmailManagerService.sendEmail(EmailManagerService.java:23)
at com.acme.foo.monitoring.alert.EmailAlertService.sendMail(EmailAlertService.java:198)
at com.acme.foo.monitoring.alert.EmailAlertService.lambda$sendKafkaConsumerRecoveredMessage$14(EmailAlertService.java:161)
at java.base@17.0.6/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
at java.base@17.0.6/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
at java.base@17.0.6/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base@17.0.6/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base@17.0.6/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base@17.0.6/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base@17.0.6/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
at com.acme.foo.monitoring.alert.EmailAlertService.sendKafkaConsumerRecoveredMessage(EmailAlertService.java:165)
at com.acme.foo.monitoring.alert.AlertService.sendKafkaConsumerRecoveredMessage(AlertService.java:156)
at com.acme.foo.monitoring.scheduler.job.KafkaConsumerHistoryNotifierJob.execute(KafkaConsumerHistoryNotifierJob.java:52)
at java.base@17.0.6/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:752)
at net.javacrumbs.shedlock.core.DefaultLockingTaskExecutor.executeWithLock(DefaultLockingTaskExecutor.java:71)
at net.javacrumbs.shedlock.spring.aop.MethodProxyScheduledLockAdvisor$LockingInterceptor.invoke(MethodProxyScheduledLockAdvisor.java:83)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:752)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703)
at com.acme.foo.monitoring.scheduler.job.KafkaConsumerHistoryNotifierJob$$SpringCGLIB$$0.execute(<generated>)
at java.base@17.0.6/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.base@17.0.6/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base@17.0.6/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base@17.0.6/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base@17.0.6/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base@17.0.6/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base@17.0.6/java.lang.Thread.run(Thread.java:833)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
I also found out that in the target/spring-aot/main/resources/META-INF/native-image/com.acme.foo/monitoring/proxy-config.json has no record of my FeignClient. It looks like it is not being scanned by the native maven plugin at all. Therefore, I did some digging in the documentation and I found out that we need to disable a few properties which has no effect on the issue unfortunately. I did try to add it via custom reflect-config and build again, but that was a dead end too. Any suggestions or directions you can lead me?
It's worth to mention that, we are providing application.yml externally to the native executable. There is no yaml at build time. I suspect that some properties may not properly initialized because of this. We are using simple discovery since our application works on K8S, the discovery is being made by KubeDNS. Since we have multiple environments, it's crucial for us that endpoints must be dynamic. One way I got it working this by disabling the simple discovery and give the url to the feign client's itself directly. However, it must be dynamic for us as I've mentioned earlier. When I try to use placeholders, it's complaining at build time that it couldn't find the placeholder. And when i assign a default value during the build time, I cannot override it at runtime.
No default value
Could not resolve placeholder 'feign.email-manager.url' in value "http://${feign.email-manager.url}"
With default value
Cause: feign.RetryableException: Connection refused executing POST http://localhost/default-path/v1/send-email
FeignClient
@FeignClient(name = "email-manager", contextId = "emailManagerFeignClient")
public interface EmailManagerFeignClient {
@PostMapping("/email-manager/v1/send-email")
void sendEmail(@RequestBody EmailRequest request);
}
Service Layer
@Service
public class EmailManagerService {
private final EmailManagerFeignClient emailManagerFeignClient;
public EmailManagerService(EmailManagerFeignClient emailManagerFeignClient) {
this.emailManagerFeignClient = emailManagerFeignClient;
}
public void sendEmail(EmailRequest request) {
emailManagerFeignClient.sendEmail(request);
}
}
application.yml
spring:
sql:
init:
platform: mssql
application:
name: monitoring
jpa:
hibernate:
ddl-auto: update
properties:
hibernate:
dialect: org.hibernate.dialect.SQLServerDialect
datasource:
url: jdbc:sqlserver://localhost:1433;databaseName=monitoring;trustServerCertificate=true
username: sa
password: mssql1Ipw
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
hikari:
connectionTestQuery: select 1
maximumPoolSize: 25
autoCommit: true
connectionTimeout: 3000
leakDetectionThreshold: 300000
liquibase:
enabled: false
change-log: classpath:/db/changelog/db.changelog-master.xml
cloud:
refresh:
enabled: false
openfeign:
client:
refresh-enabled: false
lazy-attributes-resolution: false
discovery:
client:
simple:
instances:
email-manager[0]:
uri: http://email-manager:8080/email-manager
loadbalancer:
cache:
enabled: true
kafka:
bootstrap-servers:
# - 10.2.53.30:30010
- localhost:9092
- localhost:9093
- localhost:9094
management:
server:
base-path: '/app-healthcheck'
endpoints:
web:
exposure:
include:
- '*'
base-path: '/actuator'
startup
./target/monitoring --spring.config.additional-location=/path/to/local/yml/application-local.yml
Pom.xml
```<?xml version="1.0" encoding="UTF-8"?>
<groupId>com.acme.foo</groupId>
<artifactId>monitoring</artifactId>
<version>${revision}</version>
<name>monitoring</name>
<description>Integration monitoring</description>
<properties>
<java.version>17</java.version>
<spring-cloud.version>2022.0.1</spring-cloud.version>
<revision>0-SNAPSHOT</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<start-class>com.acme.foo.monitoring.MonitoringApplication</start-class>
<logstash-logback-encoder.version>7.2</logstash-logback-encoder.version>
<org.mapstruct.version>1.5.3.Final</org.mapstruct.version>
<org.projectlombok.version>1.18.24</org.projectlombok.version>
<lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>
<json.version>20220924</json.version>
<shedlock.version>5.1.0</shedlock.version>
<springdoc-openapi-starter-webmvc-ui.version>2.0.2</springdoc-openapi-starter-webmvc-ui.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId>
<version>${shedlock.version}</version>
</dependency>
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-jdbc-template</artifactId>
<version>${shedlock.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-brave</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-properties-migrator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${org.projectlombok.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>${logstash-logback-encoder.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${org.mapstruct.version}</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>${json.version}</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>${springdoc-openapi-starter-webmvc-ui.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<annotationProcessorPaths>
<path>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${project.parent.version}</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${org.projectlombok.version}</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-mapstruct-binding</artifactId>
<version>${lombok-mapstruct-binding.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<imageName>${project.artifactId}</imageName>
<mainClass>${start-class}</mainClass>
<buildArgs>
--no-fallback
-H:+AddAllCharsets
-H:ReflectionConfigurationFiles=src/main/resources/reflect-config.json
-H:ResourceConfigurationFiles=src/main/resources/resource-config.json
-H:SerializationConfigurationFiles=src/main/resources/serialization-config.json
</buildArgs>
</configuration>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>compile-no-fork</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
**Comment From: korkutkose**
**target/spring-aot/main/resources/META-INF/native-image/com.acme.foo/monitoring/proxy-config.json**
{
"name": "com.acme.foo.monitoring.common.feign.email.service.EmailManagerService",
"queriedMethods": [
{
"name": "
**src/main/resources/META-INF/native-image/reflect-config.json generated after running with -DspringAot=true**
{
"name":"com.acme.foo.monitoring.common.feign.email.client.EmailManagerFeignClient",
"queryAllDeclaredMethods":true,
"queryAllPublicMethods":true,
"methods":[{"name":"sendEmail","parameterTypes":["com.acme.foo.monitoring.common.feign.email.service.dto.EmailRequest"] }]
},
{
"name":"com.acme.foo.monitoring.common.feign.email.service.EmailManagerService",
"allDeclaredFields":true,
"queryAllDeclaredMethods":true,
"queryAllDeclaredConstructors":true,
"methods":[{"name":"
**Comment From: korkutkose**
Ok, so as I suspected, AOT needs an application.yml to register FeignClients. Therefore I've made a simple yaml that will being used during the build time. What's cool about it, I can override the url via external yaml. In case of someone also struggles with this, I wanted to mention.
**application.yml**
spring: cloud: refresh: enabled: false openfeign: client: refresh-enabled: false lazy-attributes-resolution: false discovery: client: simple: instances: email-manager[0]: uri: http://email-manager:8080 loadbalancer: eager-load: clients: - email-manager cache: enabled: true
**Comment From: OlgaMaciaszek**
@korkutkose, it's related to Spring Cloud LoadBalancer, not Spring Cloud OF. You need to specify the service ids you'll use, as [described in the docs](https://docs.spring.io/spring-cloud-commons/docs/current/reference/html/#aot-and-native-image-support).
**Comment From: Bzaid94**
I have created two native images with GraalVM 20 and Spring Boot 3.x, both microservices connect to Eureka Client, and they work. However, when attempting to establish communication with OpenFeign, they consistently encounter the following issue:
Error: Object of class [org.springframework.context.support.GenericApplicationContext] must be an instance of interface org.springframework.context.annotation.AnnotationConfigRegistry
Given this persistent problem, I'm finding it impossible to proceed with the remaining microservices, many of which also communicate with at least one or two other services via Feign.
`
2023-07-31T17:14:24.346-06:00 INFO 9574 --- [ main] com.netflix.discovery.DiscoveryClient : The response status is 200
2023-07-31T17:14:24.346-06:00 INFO 9574 --- [ main] com.netflix.discovery.DiscoveryClient : Starting heartbeat executor: renew interval is: 30
2023-07-31T17:14:24.346-06:00 INFO 9574 --- [ main] c.n.discovery.InstanceInfoReplicator : InstanceInfoReplicator onDemand update allowed rate per min is 4
2023-07-31T17:14:24.346-06:00 INFO 9574 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1690845264346 with initial instances count: 2
2023-07-31T17:14:24.347-06:00 INFO 9574 --- [ main] o.s.c.openfeign.FeignClientFactoryBean : For 'project-physician' URL not provided. Will try picking an instance via load-balancing.
2023-07-31T17:14:24.365-06:00 WARN 9574 --- [ main] iguration$LoadBalancerCaffeineWarnLogger : Spring Cloud LoadBalancer is currently working with the default cache. While this cache implementation is useful for development and tests, it's recommended to use Caffeine cache in production.You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath.
2023-07-31T17:14:24.366-06:00 INFO 9574 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path '/actuator'
2023-07-31T17:14:24.368-06:00 INFO 9574 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application DUMMY-SERVICE with eureka with status UP
2023-07-31T17:14:24.368-06:00 INFO 9574 --- [ main] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1690845264368, current=UP, previous=STARTING]
2023-07-31T17:14:24.368-06:00 INFO 9574 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_DUMMY-SERVICE/172.20.40.23:dummy-service:6506: registering service...
2023-07-31T17:14:24.386-06:00 INFO 9574 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 6506 (http) with context path ''
2023-07-31T17:14:24.386-06:00 INFO 9574 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 6506
2023-07-31T17:14:24.387-06:00 INFO 9574 --- [ main] c.e.feignsample.FeignSampleApplication : Started FeignSampleApplication in 0.107 seconds (process running for 0.116)
2023-07-31T17:14:24.390-06:00 INFO 9574 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_DUMMY-SERVICE/172.20.40.23:dummy-service:6506 - registration status: 204
2023-07-31T17:14:31.206-06:00 INFO 9574 --- [nio-6506-exec-3] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-07-31T17:14:31.206-06:00 INFO 9574 --- [nio-6506-exec-3] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2023-07-31T17:14:31.207-06:00 INFO 9574 --- [nio-6506-exec-3] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
Error: Object of class [org.springframework.context.support.GenericApplicationContext] must be an instance of interface org.springframework.context.annotation.AnnotationConfigRegistry
`
**Comment From: OlgaMaciaszek**
Hello @Bzaid94 ; have you [disabled refresh](https://docs.spring.io/spring-cloud-openfeign/docs/current/reference/html/#aot-and-native-image-support)? If you're using load-balancing, have you [specified the load-balanced service ids](https://docs.spring.io/spring-cloud-commons/docs/current/reference/html/#aot-and-native-image-support)?
**Comment From: Bzaid94**
Thanks for answering me @OlgaMaciaszek
I have the following settings in my application-properties:
server.port=6506 spring.application.name=dummy-service
app.url.project.name=project-physician
eureka.client.register-with-eureka=true eureka.client.service-url.defaultZone=http://localhost:8761/eureka/
spring.cloud.refresh.enabled=false spring.cloud.openfeign.client.refresh-enabled=false spring.cloud.openfeign.lazy-attributes-resolution=false
As I mentioned before, I have an Eureka server service and these services do get registered. However, when I use Feign, I encounter the error.
@FeignClient("${app.url.project.name}") public interface ProjectFeign { @RequestMapping(method = RequestMethod.GET, value = "/conversion/convertLong/{length}/{from}/{to}") Double convert(@PathVariable("length") Double length, @PathVariable("from") String from, @PathVariable("to") String to); } ```
Comment From: OlgaMaciaszek
Yes, so you do not have specified the load-balanced service ids. Please follow the instructions in the linked docs section.
Comment From: Bzaid94
My bad, I just searched and added the configuration and now it works correctly :D thanks a lot
Now I will continue with another microservice that has a different error
Comment From: garikhgh
@Bzaid94 hi. what was the problem? how did you resolve it?
Comment From: imgoby
@Bzaid94 how to resolve it
Comment From: Bzaid94
@garikhgh , @imgoby I was able to fix this by adding the following configurations to the Spring Boot’s application.properties:
` spring.cloud.refresh.enabled=false spring.cloud.openfeign.client.refresh-enabled=false spring.cloud.openfeign.lazy-attributes-resolution=false
spring.cloud.loadbalancer.eager-load.clients={microservice1},{microservice2} `
Where {} is the name of each microservice registered in Eureka.
Comment From: imgoby
Thank you very much.your advice is very important,I have resove the same problem by following you guide line
Comment From: OlgaMaciaszek
Thanks @Bzaid94; @imgoby It's all described in the docs. Please make sure to consult documentation before using new functionality.
Comment From: imgoby
@OlgaMaciaszek I have checked the document and found that it is not detailed or lacks examples. The key line is: spring.cloud.refresh.enabled=false spring.cloud.loadbalancer.eager-load.clients={microservice1},{microservice2