REM:
1. 修复Undertow启动Pool警告
This commit is contained in:
HuangXin 2021-10-09 11:45:10 +08:00
parent 4c998bce48
commit 389f796970
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
package com.dispose.config;
import io.undertow.server.DefaultByteBufferPool;
import io.undertow.websockets.jsr.WebSocketDeploymentInfo;
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.stereotype.Component;
/**
* The type Undertow pool customizer.
*
* @author <huangxin@cmhi.chinamoblie.com>
*/
@Component
public class UndertowPoolCustomizer implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> {
/**
* Customize.
*
* @param factory the factory
*/
@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);
});
}
}