reactor.ipc.netty.NettyContext Java Examples

The following examples show how to use reactor.ipc.netty.NettyContext. 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: WebFluxIT.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@Override
public void executeApp() throws Exception {
    int port = getAvailablePort();
    NettyContext nettyContext = HttpServer.create("localhost", port)
            .newHandler(new ReactorHttpHandlerAdapter(new MyHttpHandler()))
            .block();

    WebClient client = WebClient.create("http://localhost:" + port);
    client.get()
            .uri("/webflux/abc")
            .retrieve()
            .bodyToMono(String.class)
            .block();

    nettyContext.dispose();
}
 
Example #2
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("8095"));
	return httpServer.newHandler(adapter).block();
}
 
Example #3
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("8908"));
	return httpServer.newHandler(adapter).block();
}
 
Example #4
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("8901"));
	return httpServer.newHandler(adapter).block();
}
 
Example #5
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("9007"));
	return httpServer.newHandler(adapter).block();
}
 
Example #6
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("9006"));
	return httpServer.newHandler(adapter).block();
}
 
Example #7
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("8901"));
	return httpServer.newHandler(adapter).block();
}
 
Example #8
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("8909"));
	return httpServer.newHandler(adapter).block();
}
 
Example #9
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("8125"));
	return httpServer.newHandler(adapter).block();
}
 
Example #10
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("9008"));
	return httpServer.newHandler(adapter).block();
}
 
Example #11
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("8901"));
	return httpServer.newHandler(adapter).block();
}
 
Example #12
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("8095"));
	return httpServer.newHandler(adapter).block();
}
 
Example #13
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("9008"));
	return httpServer.newHandler(adapter).block();
}
 
Example #14
Source File: HttpServerConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public  NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", Integer.valueOf("8908"));
	return httpServer.newHandler(adapter).block();
}
 
Example #15
Source File: Application.java    From spring-security-reactive with Apache License 2.0 5 votes vote down vote up
@Bean
public NettyContext nettyContext(ApplicationContext context) {
	HttpHandler handler = DispatcherHandler.toHttpHandler(context);
	ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
	HttpServer httpServer = HttpServer.create("localhost", port);
	return httpServer.newHandler(adapter).block();
}
 
Example #16
Source File: Application.java    From spring-security-reactive with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
	try(AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Application.class)) {
		context.getBean(NettyContext.class).onClose().block();
	}
}