-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: messagingIssues in messaging modules (jms, messaging)Issues in messaging modules (jms, messaging)type: enhancementA general enhancementA general enhancement
Milestone
Description
When using the following executor with virtual threads:
SimpleAsyncTaskExecutor executor = new SimpleAsyncTaskExecutor();
executor.setVirtualThreads(true);
The WebSocketMessageBrokerStats#getExecutorStatsInfo method returns "unknown".
private String getExecutorStatsInfo(@Nullable Executor executor) {
if (executor == null) {
return "null";
}
if (executor instanceof ThreadPoolTaskExecutor threadPoolTaskScheduler) {
executor = threadPoolTaskScheduler.getThreadPoolExecutor();
}
if (executor instanceof ThreadPoolExecutor) {
// It is assumed that the implementation of toString() in ThreadPoolExecutor
// generates text that ends similar to the following:
// pool size = #, active threads = #, queued tasks = #, completed tasks = #]
String str = executor.toString();
int indexOfPool = str.indexOf("pool");
if (indexOfPool != -1) {
// (length - 1) omits the trailing "]"
return str.substring(indexOfPool, str.length() - 1);
}
}
return "unknown";
}
It seems that only thread-pooling TaskExecutor was considered originally.
How about changing the wording?
Currently, it seems that there is no way to know if SimpleAsyncTaskExecutor is using virtual threads.
Metadata
Metadata
Assignees
Labels
in: messagingIssues in messaging modules (jms, messaging)Issues in messaging modules (jms, messaging)type: enhancementA general enhancementA general enhancement