Spring Boot WebSocketDeploymentInfo,则将使用默认工作进程

nhaq1z21  于 2022-11-05  发布在  Spring
关注(0)|答案(3)|浏览(220)

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

从谷歌搜索,似乎他们可能与Undertow建议的改进,这似乎是不可能实施。
有没有人对这些有任何进一步的澄清,也许是关于如何使日志消失的建议,因为应用程序运行得很好?

z0qdvdin

z0qdvdin1#

这是缓冲池配置的提示,不影响使用。
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);
        });
    }
}
wz1wpwve

wz1wpwve2#

如果未在SpringBoot上的Undertow中使用WebSocket。

implementation ("org.springframework.boot:spring-boot-starter-undertow") {
    exclude group: "io.undertow", module: "undertow-websockets-jsr"
}
nzkunb0c

nzkunb0c3#

网络套接字下的互斥

<exclusion><artifactId>undertow-websockets-jsr</artifactId><groupId>io.undertow</groupId></exclusion>

相关问题