Check Reactor presence after Undertow for WebSocket
Issue: SPR-15539
This commit is contained in:
parent
df8412bded
commit
9b53b86d24
|
@ -62,14 +62,14 @@ public class HandshakeWebSocketService implements WebSocketService, Lifecycle {
|
||||||
"org.eclipse.jetty.websocket.server.WebSocketServerFactory",
|
"org.eclipse.jetty.websocket.server.WebSocketServerFactory",
|
||||||
HandshakeWebSocketService.class.getClassLoader());
|
HandshakeWebSocketService.class.getClassLoader());
|
||||||
|
|
||||||
private static final boolean reactorNettyPresent = ClassUtils.isPresent(
|
|
||||||
"reactor.ipc.netty.http.server.HttpServerResponse",
|
|
||||||
HandshakeWebSocketService.class.getClassLoader());
|
|
||||||
|
|
||||||
private static final boolean undertowPresent = ClassUtils.isPresent(
|
private static final boolean undertowPresent = ClassUtils.isPresent(
|
||||||
"io.undertow.websockets.WebSocketProtocolHandshakeHandler",
|
"io.undertow.websockets.WebSocketProtocolHandshakeHandler",
|
||||||
HandshakeWebSocketService.class.getClassLoader());
|
HandshakeWebSocketService.class.getClassLoader());
|
||||||
|
|
||||||
|
private static final boolean reactorNettyPresent = ClassUtils.isPresent(
|
||||||
|
"reactor.ipc.netty.http.server.HttpServerResponse",
|
||||||
|
HandshakeWebSocketService.class.getClassLoader());
|
||||||
|
|
||||||
|
|
||||||
protected static final Log logger = LogFactory.getLog(HandshakeWebSocketService.class);
|
protected static final Log logger = LogFactory.getLog(HandshakeWebSocketService.class);
|
||||||
|
|
||||||
|
@ -104,12 +104,13 @@ public class HandshakeWebSocketService implements WebSocketService, Lifecycle {
|
||||||
else if (jettyPresent) {
|
else if (jettyPresent) {
|
||||||
className = "JettyRequestUpgradeStrategy";
|
className = "JettyRequestUpgradeStrategy";
|
||||||
}
|
}
|
||||||
else if (reactorNettyPresent) {
|
|
||||||
className = "ReactorNettyRequestUpgradeStrategy";
|
|
||||||
}
|
|
||||||
else if (undertowPresent) {
|
else if (undertowPresent) {
|
||||||
className = "UndertowRequestUpgradeStrategy";
|
className = "UndertowRequestUpgradeStrategy";
|
||||||
}
|
}
|
||||||
|
else if (reactorNettyPresent) {
|
||||||
|
// As late as possible (Reactor Netty commonly used for WebClient)
|
||||||
|
className = "ReactorNettyRequestUpgradeStrategy";
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
throw new IllegalStateException("No suitable default RequestUpgradeStrategy found");
|
throw new IllegalStateException("No suitable default RequestUpgradeStrategy found");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue