WebSocketDeploymentInfo,将使用默认的worker

Fle*_*Les 6 spring-boot undertow

在我的 SpringBoot 应用程序日志中,我看到以下警告:

UT026009: XNIO worker was not set on WebSocketDeploymentInfo, the default worker will be used
UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
Run Code Online (Sandbox Code Playgroud)

从谷歌搜索看来,它们可能与 Undertow 提出的改进建议有关,但似乎不可能实施。

有没有人对这些有任何进一步的说明,也许还有关于如何使日志消失的建议,因为应用程序运行得很好?

Sea*_*Sun 7

这是buff池配置的提醒,不影响使用。

根据https://blog.csdn.net/weixin_39841589/article/details/90582354的建议,

@Component
public class CustomizationBean implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> {
 
    @Override
    public void customize(UndertowServletWebServerFactory factory) {
        factory.addDeploymentInfoCustomizers(deploymentInfo -> {
            WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo();
            webSocketDeploymentInfo.setBuffers(new DefaultByteBufferPool(false, 1024));
            deploymentInfo.addServletContextAttribute("io.undertow.websockets.jsr.WebSocketDeploymentInfo", webSocketDeploymentInfo);
        });
    }
}
Run Code Online (Sandbox Code Playgroud)