将指标添加到Spring Cloud + Turbine中的队列时出错

时间:2018-09-03 11:18:37

标签: java spring-cloud hystrix

我正在研究pluralsight-hystrix-dashboard,并遇到错误。在此示例中,只需调用以下两个端点即可。

http://localhost:8085/turbine.stream?cluster=PLURALSIGHT-TOLLRATE-BILLBOARD http://localhost:8085/turbine.stream?cluster=PLURALSIGHT-FASTPASS-CONSOLE

我可以在Hystrix仪表板上轻松看到输出,但是下面的错误日志持续运行,仅用10个小时就使我的所有磁盘都满了。

如何避免出现以下错误?我要添加所有代码:

错误

java.lang.IllegalStateException: Queue full
    at java.util.AbstractQueue.add(Unknown Source) ~[na:1.8.0_162]
    at org.springframework.cloud.netflix.hystrix.stream.HystrixStreamTask.gatherMetrics(HystrixStreamTask.java:311) ~[spring-cloud-netflix-hystrix-stream-1.3.1.RELEASE.jar:1.3.1.RELEASE]
    at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source) ~[na:na]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_162]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_162]
    at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) [spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_162]
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [na:1.8.0_162]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [na:1.8.0_162]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.8.0_162]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_162]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_162]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_162]
2018-09-03 16:23:58.582 ERROR 11956 --- [ask-scheduler-5] o.s.c.n.h.stream.HystrixStreamTask       : Error adding metrics to queue

代码: PluralsightHystrixDashboardApplication.java

@EnableTurbine
@EnableHystrixDashboard
@SpringBootApplication
public class PluralsightHystrixDashboardApplication {

    public static void main(String[] args) {
        SpringApplication.run(PluralsightHystrixDashboardApplication.class, args);
    }
}

application.properties

server.port=8085
eureka.client.register-with-eureka=false

#turbine settings
turbine.app-config=pluralsight-tollrate-billboard,pluralsight-fastpass-console
turbine.aggregator.clusterConfig=PLURALSIGHT-TOLLRATE-BILLBOARD,PLURALSIGHT-FASTPASS-CONSOLE

enter image description here

0 个答案:

没有答案