org.springframework.boot.web.reactive.server.ReactiveWebServerFactory Java Examples

The following examples show how to use org.springframework.boot.web.reactive.server.ReactiveWebServerFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RoutingConfig.java    From pitchfork with Apache License 2.0 5 votes vote down vote up
/**
 * Since we're impersonating a {@code Zipkin} server we need to support the same set of features.
 * One of the features is request compression, which we handle here by adding a {@link HttpContentDecompressor} to the {@code Netty} pipeline.
 */
@Bean
public ReactiveWebServerFactory reactiveWebServerFactory() {
    NettyReactiveWebServerFactory factory = new NettyReactiveWebServerFactory();

    factory.addServerCustomizers(builder -> builder
            .tcpConfiguration(tcpServer -> {
                return tcpServer.doOnConnection(connection -> connection.addHandler("decompressor", new HttpContentDecompressor()));
            }));

    return factory;
}
 
Example #2
Source File: ArmeriaReactiveWebServerFactoryTest.java    From armeria with Apache License 2.0 5 votes vote down vote up
private static void runServer(ReactiveWebServerFactory factory,
                              HttpHandler httpHandler,
                              Consumer<WebServer> validator) {
    final WebServer server = factory.getWebServer(httpHandler);
    server.start();
    try {
        validator.accept(server);
    } finally {
        server.stop();
    }
}
 
Example #3
Source File: AllFeaturesTest.java    From feign-reactive with Apache License 2.0 4 votes vote down vote up
@Bean
public ReactiveWebServerFactory reactiveWebServerFactory(){
	return new NettyReactiveWebServerFactory();
}
 
Example #4
Source File: ArmeriaReactiveWebServerFactoryTest.java    From armeria with Apache License 2.0 4 votes vote down vote up
private static void runEchoServer(ReactiveWebServerFactory factory,
                                  Consumer<WebServer> validator) {
    runServer(factory, EchoHandler.INSTANCE, validator);
}