@Bean public HttpServer httpServer(RouterFunction<?> routerFunction) { HttpHandler httpHandler = RouterFunctions.toHttpHandler(routerFunction); ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(httpHandler); HttpServer server = HttpServer .create(serverConfigBean.getAddress(), serverConfigBean.getPort()); server.newHandler(adapter); return server; }
private void startReactorServer() { RouterFunction<?> route = routingFunction(); HttpHandler httpHandler = toHttpHandler(route); ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(httpHandler); HttpServer server = HttpServer.create(HOST, PORT); server.newHandler(adapter).block(); }
@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(); }
@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(); }
@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(); }
@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(); }
@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(); }
@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(); }
@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(); }
@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(); }
@Bean public HttpServer reactorServer(){ HttpHandler handler = DispatcherHandler.toHttpHandler(context); ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler); HttpServer httpServer = HttpServer.create(port); httpServer.newHandler(adapter).block(); return httpServer; }
@Bean public HttpServer reactorServer(){ HttpHandler handler = routingHandler(); //HttpHandler handler = dispatcherHandler(context); ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler); HttpServer httpServer = HttpServer.create(port); httpServer.newHandler(adapter).block(); return httpServer; }
@Before public void startServer(){ if(!isServerStarted) { AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(); ac.register(TestingConfiguration.class); ac.refresh(); ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(WebHttpHandlerBuilder.webHandler(new DispatcherHandler(ac)).build()); HttpServer httpServer = HttpServer.create(PORT); httpServer.newHandler(adapter).block(); isServerStarted = true; } }
@Profile("default") @Bean public NettyContext nettyContext(ApplicationContext context) { HttpHandler handler = WebHttpHandlerBuilder.applicationContext(context).build(); ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler); HttpServer httpServer = HttpServer.create("localhost", this.port); return httpServer.newHandler(adapter).block(); }