gpt4 book ai didi

netflix-eureka - spring-cloud-config 和 spring-cloud-bus 问题

转载 作者:行者123 更新时间:2023-12-02 01:25:12 24 4
gpt4 key购买 nike

我有三个应用程序,一个是 spring-cloud-config 服务器点,其他是 spring-cloud-config 客户端点。我在彼此中配置了 spring-cloud-bus 以使我的客户端点自动刷新更改但在我的应用程序运行时,我得到了一个异常

    c.netflix.discovery.TimedSupervisorTask  : task supervisor rejected the task

java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@17834c50 rejected from java.util.concurrent.ThreadPoolExecutor@1944b0d0[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047) ~[na:1.8.0_92]
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823) [na:1.8.0_92]
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369) [na:1.8.0_92]
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) ~[na:1.8.0_92]
at com.netflix.discovery.TimedSupervisorTask.run(TimedSupervisorTask.java:62) ~[eureka-client-1.4.6.jar:1.4.6]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_92]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_92]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_92]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_92]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_92]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_92]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_92]

这是我的 spring-cloud-server 配置
#git config
spring.cloud.config.server.git.uri = ###
spring.cloud.config.server.git.username=###
spring.cloud.config.server.git.password=###
spring.cloud.config.server.git.search-paths = puhui-cloud-config-client

#spring.active.profile
spring.profiles.active=dev

#spring-cloud-bus-amqp config
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.virtual-host=/

这是我的 spring-cloud-config 服务器 pom
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>

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

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

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-monitor</artifactId>
</dependency>

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

</dependencies>

这是我的 spring-cloud-config 客户端配置
#spring-cloud-config
spring.cloud.config.discovery.serviceId = PUHUI-CLOUD-CONFIG-SERVER
spring.cloud.config.name = @project.artifactId@
spring.cloud.config.profile = @profiles.active@
spring.cloud.config.label= master

spring.rabbitmq.host = localhost
spring.rabbitmq.port = 5672

这是我的 spring-cloud-config 客户端点 pom
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>

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

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>
</dependencies>

这个异常不会影响操作的应用程序,但是我想知道应用程序为什么会抛出异常

最佳答案

尝试在发现服务器中为客户端启用注册和获取注册表

eureka.client.registerWithEureka=true

eureka.client.fetchRegistry=true

关于netflix-eureka - spring-cloud-config 和 spring-cloud-bus 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37542939/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com