@Override public ChannelHandler getApplicationRouter() { return new PipelineRouter( ImmutableMap.of(), new PipelineRequestHandler() { @Override public void handle( ChannelHandlerContext ctx, Request request, RouteState route) { if (request instanceof SegmentedRequestData) { SegmentedRequestData streaming = (SegmentedRequestData) request; if (streaming.endOfMessage()) { ctx.write(Http2Response.build(request.streamId(), cannedHeaders)); ctx.write( Http2Response.build(request.streamId(), cannedData, false)); ctx.write( Http2Response.build(request.streamId(), cannedTrailers, true)); } } } }); } });
@Override public ChannelHandler getApplicationRouter() { return new PipelineRouter(state.routes()); // new ConfigurableHandler(new PipelineRouter(routes), RouteUpdateClass.class) // new ConfigurableInboundHandler(inbound handler class type, update class type) // new ConfigurableOutboundHandler(outbound handler class type, update class type) // new ConfigurableDuplexHandler(duplex handler class type, update class type) }
@Override public ChannelHandler getApplicationRouter() { return new PipelineRouter( ImmutableMap.of(), new ProxyPipelineRequestHandler(boundAddress, true)); } };
@Override public ChannelHandler getApplicationRouter() { return new PipelineRouter( ImmutableMap.of( "none", ProxyRouteState.create( appState, proxyConfig, new ProxyHandler( factory, proxyConfig, new SocketAddressHelper())))); } });
@Override public ChannelHandler getApplicationRouter() { RouteConfig config = new RouteConfig(ConfigFactory.load().getConfig("xio.defaultRoute")); GrpcRequestHandler handler = new GrpcRequestHandler<>( HelloRequest::parseFrom, (HelloRequest request) -> HelloReply.newBuilder() .setMessage("Hello " + request.getName()) .build()); return new PipelineRouter( ImmutableMap.of( sayHelloPath, new RouteState( (ignored) -> Route.build(sayHelloPath), config, handler))); } });