【问题标题】:Jersey Rx client jersey-client-async-executor shutdownJersey Rx 客户端 jersey-client-async-executor 关闭
【发布时间】:2016-11-21 18:17:12
【问题描述】:
Web 应用程序 [ROOT] 似乎已经启动了一个名为 [jersey-client-async-executor-0] 的线程,但未能停止它。
如何优雅地关闭 jersey-client-async-executor?
这与 Spring Boot 一起使用,JerseyRxClient 与嵌入式 tomcat。
【问题讨论】:
标签:
spring-boot
jersey
rx-java
jersey-2.0
jersey-client
【解决方案1】:
Jersey 在请求完成后优雅地终止线程。
我正在使用 Spring Boot 调度程序使用 rx jersey 客户端发出异步请求。
我有同样的疑问,每次调度程序运行时,泽西客户端都会创建新线程来增加数量。
为了确保线程被终止,
简单测试:
In your subscriber,
Set<Thread> threadSet = Thread.getAllStackTraces().keySet();
这不会列出用于发出请求的 jersey-client-async-executor-*。