<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Dalston.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency>
Phenomenon:
If eureka health check configuration is opened in zuul:
eureka: client: healthcheck: enabled: true serviceUrl: defaultZone: http://localhost:8761/eureka/
When calling /refresh to dynamically refresh the routing configuration, zuul will throw a java.util.concurrent.RejectedExecutionException exception. Looking at the exception information, it seems that the initial size of the thread pool is 0.
Solution:
Turn off the health check or set the size of the health check thread pool.
eureka: client: healthcheck: enabled: true heartbeat-executor-thread-pool-size: 5 serviceUrl: defaultZone: http://localhost:8761/eureka/
Calling /refresh no longer throws an exception!