Reactor Netty WebSocket server-side support

Issue: SPR-14527
This commit is contained in:
Rossen Stoyanchev
2016-12-06 16:09:24 -05:00
parent 46f2aafdc0
commit c097c0284a
7 changed files with 232 additions and 8 deletions

View File

@@ -27,11 +27,13 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.bootstrap.HttpServer;
import org.springframework.http.server.reactive.bootstrap.ReactorHttpServer;
import org.springframework.http.server.reactive.bootstrap.RxNettyHttpServer;
import org.springframework.util.SocketUtils;
import org.springframework.web.reactive.DispatcherHandler;
import org.springframework.web.reactive.socket.server.support.HandshakeWebSocketService;
import org.springframework.web.reactive.socket.server.support.WebSocketHandlerAdapter;
import org.springframework.web.reactive.socket.server.upgrade.ReactorNettyRequestUpgradeStrategy;
import org.springframework.web.reactive.socket.server.upgrade.RxNettyRequestUpgradeStrategy;
/**
@@ -58,6 +60,7 @@ public abstract class AbstractWebSocketHandlerIntegrationTests {
@Parameters
public static Object[][] arguments() {
return new Object[][] {
{new ReactorHttpServer(), ReactorNettyConfig.class},
{new RxNettyHttpServer(), RxNettyConfig.class}
};
}
@@ -110,6 +113,15 @@ public abstract class AbstractWebSocketHandlerIntegrationTests {
}
@Configuration
static class ReactorNettyConfig extends AbstractHandlerAdapterConfig {
@Override
protected RequestUpgradeStrategy createUpgradeStrategy() {
return new ReactorNettyRequestUpgradeStrategy();
}
}
@Configuration
static class RxNettyConfig extends AbstractHandlerAdapterConfig {

View File

@@ -39,7 +39,7 @@ import org.springframework.web.reactive.socket.WebSocketSession;
import static org.junit.Assert.assertEquals;
/**
* Basic WebSocket integration
* Basic WebSocket integration tests.
* @author Rossen Stoyanchev
*/
@SuppressWarnings({"unused", "WeakerAccess"})