spring-boot - WebSocketDeploymentInfo,将使用默认的worker

标签 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

从 Google 搜索来看,它们似乎与 Undertow 有关,建议进行一项似乎无法实现的改进。

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

最佳答案

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

关于spring-boot - WebSocketDeploymentInfo,将使用默认的worker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60705285/

相关文章:

java - ResponseEntity 无法解析为类型

spring - JdbcTemplate 中的 Multi-Tenancy

spring - 如何优雅地关闭 spring boot 应用程序

spring-boot - SpringBoot Gradle 插件不会重新打包 Maven 子模块(内部解决方法)

Wildfly 上的 Spring Security : error while executing the filter chain

java - Servlet/Undertow - 访问 HttpServletRequest 和 HttpServletResponse

java - org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure : Could not find MessageBodyWriter for response object of type

java - 在嵌入式 undertow 中部署 servlets webapp

spring-boot - 如何在同一个项目中同时拥有 Velocity 和 Thymeleaf,但 Controller 仅使用其中之一

java - 使用 Java、Spring、Jsp、Extjs 获取 Wildfly 8.2.0 Final - Undertow "UT010019: Response already commited"错误