【问题标题】:WebSocketDeploymentInfo, the default worker will be usedWebSocketDeploymentInfo,将使用默认worker
【发布时间】:2020-06-27 12:36:01
【问题描述】:

在我的 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

从 Google 搜索看来,它们可能与 Undertow 有关,建议进行一项似乎不可能实施的改进。

有没有人对这些有任何进一步的澄清,或者关于如何使日志消失的建议,因为应用程序运行得很好?

【问题讨论】:

    标签: spring-boot undertow


    【解决方案1】:

    是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);
            });
        }
    }
    

    【讨论】:

    • 很遗憾,您必须添加此样板才能摆脱不相关的警告。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-14
    • 1970-01-01
    • 2013-06-13
    • 2020-10-24
    • 2013-06-26
    相关资源
    最近更新 更多