【问题标题】:Spring Integration TCP Performance MonitorSpring 集成 TCP 性能监视器
【发布时间】:2017-12-19 13:30:02
【问题描述】:
【问题讨论】:
标签:
spring
performance
spring-integration
【解决方案1】:
你可以在AbstractConnectionFactory上使用这个:
/**
* Returns a list of (currently) open {@link TcpConnection} connection ids; allows,
* for example, broadcast operations to all open connections.
* @return the list of connection ids.
*/
public List<String> getOpenConnectionIds() {
return Collections.unmodifiableList(this.removeClosedConnectionsAndReturnOpenConnectionIds());
}
您可以从外部配置的ThreadPoolTaskExecutor 获取线程统计信息并通过以下方式注入AbstractConnectionFactory:
/**
* @param taskExecutor the taskExecutor to set
*/
public void setTaskExecutor(Executor taskExecutor) {
this.taskExecutor = taskExecutor;
}