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",
|
||||
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(
|
||||
"io.undertow.websockets.WebSocketProtocolHandshakeHandler",
|
||||
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);
|
||||
|
||||
|
@ -104,12 +104,13 @@ public class HandshakeWebSocketService implements WebSocketService, Lifecycle {
|
|||
else if (jettyPresent) {
|
||||
className = "JettyRequestUpgradeStrategy";
|
||||
}
|
||||
else if (reactorNettyPresent) {
|
||||
className = "ReactorNettyRequestUpgradeStrategy";
|
||||
}
|
||||
else if (undertowPresent) {
|
||||
className = "UndertowRequestUpgradeStrategy";
|
||||
}
|
||||
else if (reactorNettyPresent) {
|
||||
// As late as possible (Reactor Netty commonly used for WebClient)
|
||||
className = "ReactorNettyRequestUpgradeStrategy";
|
||||
}
|
||||
else {
|
||||
throw new IllegalStateException("No suitable default RequestUpgradeStrategy found");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue