Search in sources :

Example 6 with NettyHttpRequest

use of io.micronaut.http.server.netty.NettyHttpRequest in project micronaut-core by micronaut-projects.

the class NettySystemFileCustomizableResponseType method write.

@Override
public void write(HttpRequest<?> request, MutableHttpResponse<?> response, ChannelHandlerContext context) {
    if (response instanceof NettyMutableHttpResponse) {
        NettyMutableHttpResponse nettyResponse = ((NettyMutableHttpResponse) response);
        // Write the request data
        final DefaultHttpResponse finalResponse = new DefaultHttpResponse(nettyResponse.getNettyHttpVersion(), nettyResponse.getNettyHttpStatus(), nettyResponse.getNettyHeaders());
        if (request instanceof NettyHttpRequest) {
            ((NettyHttpRequest<?>) request).prepareHttp2ResponseIfNecessary(finalResponse);
        }
        context.write(finalResponse, context.voidPromise());
        FileHolder file = new FileHolder(getFile());
        // Write the content.
        if (context.pipeline().get(SslHandler.class) == null && context.pipeline().get(SmartHttpContentCompressor.class).shouldSkip(finalResponse)) {
            // SSL not enabled - can use zero-copy file transfer.
            context.write(new DefaultFileRegion(file.raf.getChannel(), 0, getLength()), context.newProgressivePromise()).addListener(file);
            context.writeAndFlush(LastHttpContent.EMPTY_LAST_CONTENT);
        } else {
            // SSL enabled - cannot use zero-copy file transfer.
            try {
                // HttpChunkedInput will write the end marker (LastHttpContent) for us.
                final HttpChunkedInput chunkedInput = new HttpChunkedInput(new ChunkedFile(file.raf, 0, getLength(), LENGTH_8K));
                context.writeAndFlush(chunkedInput, context.newProgressivePromise()).addListener(file);
            } catch (IOException e) {
                throw new CustomizableResponseTypeException("Could not read file", e);
            }
        }
    } else {
        throw new IllegalArgumentException("Unsupported response type. Not a Netty response: " + response);
    }
}
Also used : NettyMutableHttpResponse(io.micronaut.http.netty.NettyMutableHttpResponse) HttpChunkedInput(io.netty.handler.codec.http.HttpChunkedInput) DefaultHttpResponse(io.netty.handler.codec.http.DefaultHttpResponse) ChunkedFile(io.netty.handler.stream.ChunkedFile) NettyHttpRequest(io.micronaut.http.server.netty.NettyHttpRequest) IOException(java.io.IOException) DefaultFileRegion(io.netty.channel.DefaultFileRegion) CustomizableResponseTypeException(io.micronaut.http.server.types.CustomizableResponseTypeException)

Example 7 with NettyHttpRequest

use of io.micronaut.http.server.netty.NettyHttpRequest in project micronaut-core by micronaut-projects.

the class NettyServerWebSocketUpgradeHandler method handleHandshake.

/**
 * Do the handshaking for WebSocket request.
 *
 * @param ctx           The channel handler context
 * @param req           The request
 * @param webSocketBean The web socket bean
 * @param response      The response
 * @return The channel future
 */
protected ChannelFuture handleHandshake(ChannelHandlerContext ctx, NettyHttpRequest req, WebSocketBean<?> webSocketBean, MutableHttpResponse<?> response) {
    int maxFramePayloadLength = webSocketBean.messageMethod().map(m -> m.intValue(OnMessage.class, "maxPayloadLength").orElse(65536)).orElse(65536);
    String subprotocols = webSocketBean.getBeanDefinition().stringValue(ServerWebSocket.class, "subprotocols").filter(s -> !StringUtils.isEmpty(s)).orElse(null);
    WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(getWebSocketURL(ctx, req), subprotocols, true, maxFramePayloadLength);
    handshaker = wsFactory.newHandshaker(req.getNativeRequest());
    MutableHttpHeaders headers = response.getHeaders();
    io.netty.handler.codec.http.HttpHeaders nettyHeaders;
    if (headers instanceof NettyHttpHeaders) {
        nettyHeaders = ((NettyHttpHeaders) headers).getNettyHeaders();
    } else {
        nettyHeaders = new DefaultHttpHeaders();
        for (Map.Entry<String, List<String>> entry : headers) {
            nettyHeaders.add(entry.getKey(), entry.getValue());
        }
    }
    Channel channel = ctx.channel();
    if (handshaker == null) {
        return WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse(channel);
    } else {
        return handshaker.handshake(channel, req.getNativeRequest(), nettyHeaders, channel.newPromise());
    }
}
Also used : RouteExecutor(io.micronaut.http.server.RouteExecutor) HttpHeaders(io.netty.handler.codec.http.HttpHeaders) WebSocketServerHandshakerFactory(io.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory) LoggerFactory(org.slf4j.LoggerFactory) AsciiString(io.netty.util.AsciiString) Internal(io.micronaut.core.annotation.Internal) CloseReason(io.micronaut.websocket.CloseReason) OnOpen(io.micronaut.websocket.annotation.OnOpen) HttpStatus(io.micronaut.http.HttpStatus) Map(java.util.Map) HttpResponse(io.micronaut.http.HttpResponse) RequestBinderRegistry(io.micronaut.http.bind.RequestBinderRegistry) NettyHttpRequest(io.micronaut.http.server.netty.NettyHttpRequest) MutableHttpResponse(io.micronaut.http.MutableHttpResponse) MutableHttpHeaders(io.micronaut.http.MutableHttpHeaders) ChannelPipeline(io.netty.channel.ChannelPipeline) StringUtils(io.micronaut.core.util.StringUtils) List(java.util.List) DefaultHttpHeaders(io.netty.handler.codec.http.DefaultHttpHeaders) SslHandler(io.netty.handler.ssl.SslHandler) Optional(java.util.Optional) HttpAttributes(io.micronaut.http.HttpAttributes) WebSocketSessionRepository(io.micronaut.http.netty.websocket.WebSocketSessionRepository) WebSocketBean(io.micronaut.websocket.context.WebSocketBean) OnMessage(io.micronaut.websocket.annotation.OnMessage) Scheduler(reactor.core.scheduler.Scheduler) AtomicReference(java.util.concurrent.atomic.AtomicReference) WebSocketBeanRegistry(io.micronaut.websocket.context.WebSocketBeanRegistry) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) NettyHttpHeaders(io.micronaut.http.netty.NettyHttpHeaders) UriRouteMatch(io.micronaut.web.router.UriRouteMatch) Schedulers(reactor.core.scheduler.Schedulers) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) HttpRequest(io.micronaut.http.HttpRequest) ServerRequestContext(io.micronaut.http.context.ServerRequestContext) MediaTypeCodecRegistry(io.micronaut.http.codec.MediaTypeCodecRegistry) HttpStatusException(io.micronaut.http.exceptions.HttpStatusException) HttpMethod(io.micronaut.http.HttpMethod) Logger(org.slf4j.Logger) HttpHeaderValues(io.netty.handler.codec.http.HttpHeaderValues) Publisher(org.reactivestreams.Publisher) Mono(reactor.core.publisher.Mono) ChannelFuture(io.netty.channel.ChannelFuture) Channel(io.netty.channel.Channel) Consumer(java.util.function.Consumer) NonNull(io.micronaut.core.annotation.NonNull) Flux(reactor.core.publisher.Flux) NettyEmbeddedServices(io.micronaut.http.server.netty.NettyEmbeddedServices) SimpleChannelInboundHandler(io.netty.channel.SimpleChannelInboundHandler) ServerWebSocket(io.micronaut.websocket.annotation.ServerWebSocket) WebSocketServerHandshaker(io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker) ChannelPipelineCustomizer(io.micronaut.http.netty.channel.ChannelPipelineCustomizer) ChannelHandler(io.netty.channel.ChannelHandler) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) Router(io.micronaut.web.router.Router) HttpHeaders(io.netty.handler.codec.http.HttpHeaders) Channel(io.netty.channel.Channel) WebSocketServerHandshakerFactory(io.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory) OnMessage(io.micronaut.websocket.annotation.OnMessage) AsciiString(io.netty.util.AsciiString) NettyHttpHeaders(io.micronaut.http.netty.NettyHttpHeaders) DefaultHttpHeaders(io.netty.handler.codec.http.DefaultHttpHeaders) MutableHttpHeaders(io.micronaut.http.MutableHttpHeaders) List(java.util.List) Map(java.util.Map)

Example 8 with NettyHttpRequest

use of io.micronaut.http.server.netty.NettyHttpRequest in project micronaut-core by micronaut-projects.

the class NettyServerWebSocketUpgradeHandler method channelRead0.

@Override
protected final void channelRead0(ChannelHandlerContext ctx, NettyHttpRequest<?> msg) {
    ServerRequestContext.set(msg);
    Optional<UriRouteMatch<Object, Object>> optionalRoute = router.find(HttpMethod.GET, msg.getUri().toString(), msg).filter(rm -> rm.isAnnotationPresent(OnMessage.class) || rm.isAnnotationPresent(OnOpen.class)).findFirst();
    MutableHttpResponse<?> proceed = HttpResponse.ok();
    AtomicReference<HttpRequest<?>> requestReference = new AtomicReference<>(msg);
    Flux<MutableHttpResponse<?>> responsePublisher;
    if (optionalRoute.isPresent()) {
        UriRouteMatch<Object, Object> rm = optionalRoute.get();
        msg.setAttribute(HttpAttributes.ROUTE_MATCH, rm);
        msg.setAttribute(HttpAttributes.ROUTE_INFO, rm);
        proceed.setAttribute(HttpAttributes.ROUTE_MATCH, rm);
        proceed.setAttribute(HttpAttributes.ROUTE_INFO, rm);
        responsePublisher = Flux.just(proceed);
    } else {
        responsePublisher = routeExecutor.onError(new HttpStatusException(HttpStatus.NOT_FOUND, "WebSocket Not Found"), msg);
    }
    Publisher<? extends MutableHttpResponse<?>> finalPublisher = routeExecutor.filterPublisher(requestReference, responsePublisher);
    final Scheduler scheduler = Schedulers.fromExecutorService(ctx.channel().eventLoop());
    Mono.from(finalPublisher).publishOn(scheduler).subscribeOn(scheduler).contextWrite(reactorContext -> reactorContext.put(ServerRequestContext.KEY, requestReference.get())).subscribe((Consumer<MutableHttpResponse<?>>) actualResponse -> {
        if (actualResponse == proceed) {
            UriRouteMatch routeMatch = actualResponse.getAttribute(HttpAttributes.ROUTE_MATCH, UriRouteMatch.class).get();
            WebSocketBean<?> webSocketBean = webSocketBeanRegistry.getWebSocket(routeMatch.getTarget().getClass());
            handleHandshake(ctx, msg, webSocketBean, actualResponse);
            ChannelPipeline pipeline = ctx.pipeline();
            try {
                NettyServerWebSocketHandler webSocketHandler = new NettyServerWebSocketHandler(nettyEmbeddedServices, webSocketSessionRepository, handshaker, webSocketBean, msg, routeMatch, ctx, routeExecutor.getCoroutineHelper().orElse(null));
                pipeline.addBefore(ctx.name(), NettyServerWebSocketHandler.ID, webSocketHandler);
                pipeline.remove(ChannelPipelineCustomizer.HANDLER_HTTP_STREAM);
                pipeline.remove(NettyServerWebSocketUpgradeHandler.this);
                ChannelHandler accessLoggerHandler = pipeline.get(ChannelPipelineCustomizer.HANDLER_ACCESS_LOGGER);
                if (accessLoggerHandler != null) {
                    pipeline.remove(accessLoggerHandler);
                }
            } catch (Throwable e) {
                if (LOG.isErrorEnabled()) {
                    LOG.error("Error opening WebSocket: " + e.getMessage(), e);
                }
                ctx.writeAndFlush(new CloseWebSocketFrame(CloseReason.INTERNAL_ERROR.getCode(), CloseReason.INTERNAL_ERROR.getReason()));
            }
        } else {
            ctx.writeAndFlush(actualResponse);
        }
    });
}
Also used : RouteExecutor(io.micronaut.http.server.RouteExecutor) HttpHeaders(io.netty.handler.codec.http.HttpHeaders) WebSocketServerHandshakerFactory(io.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory) LoggerFactory(org.slf4j.LoggerFactory) AsciiString(io.netty.util.AsciiString) Internal(io.micronaut.core.annotation.Internal) CloseReason(io.micronaut.websocket.CloseReason) OnOpen(io.micronaut.websocket.annotation.OnOpen) HttpStatus(io.micronaut.http.HttpStatus) Map(java.util.Map) HttpResponse(io.micronaut.http.HttpResponse) RequestBinderRegistry(io.micronaut.http.bind.RequestBinderRegistry) NettyHttpRequest(io.micronaut.http.server.netty.NettyHttpRequest) MutableHttpResponse(io.micronaut.http.MutableHttpResponse) MutableHttpHeaders(io.micronaut.http.MutableHttpHeaders) ChannelPipeline(io.netty.channel.ChannelPipeline) StringUtils(io.micronaut.core.util.StringUtils) List(java.util.List) DefaultHttpHeaders(io.netty.handler.codec.http.DefaultHttpHeaders) SslHandler(io.netty.handler.ssl.SslHandler) Optional(java.util.Optional) HttpAttributes(io.micronaut.http.HttpAttributes) WebSocketSessionRepository(io.micronaut.http.netty.websocket.WebSocketSessionRepository) WebSocketBean(io.micronaut.websocket.context.WebSocketBean) OnMessage(io.micronaut.websocket.annotation.OnMessage) Scheduler(reactor.core.scheduler.Scheduler) AtomicReference(java.util.concurrent.atomic.AtomicReference) WebSocketBeanRegistry(io.micronaut.websocket.context.WebSocketBeanRegistry) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) NettyHttpHeaders(io.micronaut.http.netty.NettyHttpHeaders) UriRouteMatch(io.micronaut.web.router.UriRouteMatch) Schedulers(reactor.core.scheduler.Schedulers) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) HttpRequest(io.micronaut.http.HttpRequest) ServerRequestContext(io.micronaut.http.context.ServerRequestContext) MediaTypeCodecRegistry(io.micronaut.http.codec.MediaTypeCodecRegistry) HttpStatusException(io.micronaut.http.exceptions.HttpStatusException) HttpMethod(io.micronaut.http.HttpMethod) Logger(org.slf4j.Logger) HttpHeaderValues(io.netty.handler.codec.http.HttpHeaderValues) Publisher(org.reactivestreams.Publisher) Mono(reactor.core.publisher.Mono) ChannelFuture(io.netty.channel.ChannelFuture) Channel(io.netty.channel.Channel) Consumer(java.util.function.Consumer) NonNull(io.micronaut.core.annotation.NonNull) Flux(reactor.core.publisher.Flux) NettyEmbeddedServices(io.micronaut.http.server.netty.NettyEmbeddedServices) SimpleChannelInboundHandler(io.netty.channel.SimpleChannelInboundHandler) ServerWebSocket(io.micronaut.websocket.annotation.ServerWebSocket) WebSocketServerHandshaker(io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker) ChannelPipelineCustomizer(io.micronaut.http.netty.channel.ChannelPipelineCustomizer) ChannelHandler(io.netty.channel.ChannelHandler) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) Router(io.micronaut.web.router.Router) NettyHttpRequest(io.micronaut.http.server.netty.NettyHttpRequest) HttpRequest(io.micronaut.http.HttpRequest) CloseWebSocketFrame(io.netty.handler.codec.http.websocketx.CloseWebSocketFrame) MutableHttpResponse(io.micronaut.http.MutableHttpResponse) Scheduler(reactor.core.scheduler.Scheduler) WebSocketBean(io.micronaut.websocket.context.WebSocketBean) HttpStatusException(io.micronaut.http.exceptions.HttpStatusException) AtomicReference(java.util.concurrent.atomic.AtomicReference) OnMessage(io.micronaut.websocket.annotation.OnMessage) OnOpen(io.micronaut.websocket.annotation.OnOpen) ChannelHandler(io.netty.channel.ChannelHandler) ChannelPipeline(io.netty.channel.ChannelPipeline) UriRouteMatch(io.micronaut.web.router.UriRouteMatch)

Example 9 with NettyHttpRequest

use of io.micronaut.http.server.netty.NettyHttpRequest in project micronaut-core by micronaut-projects.

the class HttpRequestTest method testForEach.

public void testForEach() {
    final DefaultFullHttpRequest nettyRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, io.netty.handler.codec.http.HttpMethod.GET, "/test");
    nettyRequest.headers().add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
    HttpRequest<?> request = new NettyHttpRequest(nettyRequest, new DetachedMockFactory().Mock(ChannelHandlerContext.class), ConversionService.SHARED, new HttpServerConfiguration());
    final HttpHeaders headers = request.getHeaders();
    headers.forEach((name, values) -> {
        assertEquals(HttpHeaders.CONTENT_TYPE, name);
        assertEquals(1, values.size());
        assertEquals(MediaType.APPLICATION_JSON, values.iterator().next());
    });
}
Also used : HttpHeaders(io.micronaut.http.HttpHeaders) DefaultFullHttpRequest(io.netty.handler.codec.http.DefaultFullHttpRequest) HttpServerConfiguration(io.micronaut.http.server.HttpServerConfiguration) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) NettyHttpRequest(io.micronaut.http.server.netty.NettyHttpRequest) DetachedMockFactory(spock.mock.DetachedMockFactory)

Example 10 with NettyHttpRequest

use of io.micronaut.http.server.netty.NettyHttpRequest in project micronaut-core by micronaut-projects.

the class MultipartBodyArgumentBinder method bind.

@Override
public BindingResult<MultipartBody> bind(ArgumentConversionContext<MultipartBody> context, HttpRequest<?> source) {
    if (source instanceof NettyHttpRequest) {
        NettyHttpRequest nettyHttpRequest = (NettyHttpRequest) source;
        io.netty.handler.codec.http.HttpRequest nativeRequest = nettyHttpRequest.getNativeRequest();
        if (nativeRequest instanceof StreamedHttpRequest) {
            HttpContentProcessor<?> processor = beanLocator.findBean(HttpContentSubscriberFactory.class, new ConsumesMediaTypeQualifier<>(MediaType.MULTIPART_FORM_DATA_TYPE)).map(factory -> factory.build(nettyHttpRequest)).orElse(new DefaultHttpContentProcessor(nettyHttpRequest, httpServerConfiguration.get()));
            // noinspection unchecked
            return () -> Optional.of(subscriber -> processor.subscribe(new TypedSubscriber<Object>((Argument) context.getArgument()) {

                Subscription s;

                AtomicLong partsRequested = new AtomicLong(0);

                @Override
                protected void doOnSubscribe(Subscription subscription) {
                    this.s = subscription;
                    subscriber.onSubscribe(new Subscription() {

                        @Override
                        public void request(long n) {
                            if (partsRequested.getAndUpdate(prev -> prev + n) == 0) {
                                s.request(n);
                            }
                        }

                        @Override
                        public void cancel() {
                            subscription.cancel();
                        }
                    });
                }

                @Override
                protected void doOnNext(Object message) {
                    if (LOG.isTraceEnabled()) {
                        LOG.trace("Server received streaming message for argument [{}]: {}", context.getArgument(), message);
                    }
                    if (message instanceof ByteBufHolder && ((ByteBufHolder) message).content() instanceof EmptyByteBuf) {
                        return;
                    }
                    if (message instanceof HttpData) {
                        HttpData data = (HttpData) message;
                        if (data.isCompleted()) {
                            partsRequested.decrementAndGet();
                            if (data instanceof FileUpload) {
                                subscriber.onNext(new NettyCompletedFileUpload((FileUpload) data, false));
                            } else if (data instanceof Attribute) {
                                subscriber.onNext(new NettyCompletedAttribute((Attribute) data, false));
                            }
                            // If the user didn't release the data, we should
                            if (data.refCnt() > 0) {
                                data.release();
                            }
                        }
                    }
                    if (partsRequested.get() > 0) {
                        s.request(1);
                    }
                }

                @Override
                protected void doOnError(Throwable t) {
                    if (LOG.isTraceEnabled()) {
                        LOG.trace("Server received error for argument [" + context.getArgument() + "]: " + t.getMessage(), t);
                    }
                    try {
                        subscriber.onError(t);
                    } finally {
                        s.cancel();
                    }
                }

                @Override
                protected void doOnComplete() {
                    if (LOG.isTraceEnabled()) {
                        LOG.trace("Done receiving messages for argument: {}", context.getArgument());
                    }
                    subscriber.onComplete();
                }
            }));
        }
    }
    return BindingResult.EMPTY;
}
Also used : ArgumentConversionContext(io.micronaut.core.convert.ArgumentConversionContext) LoggerFactory(org.slf4j.LoggerFactory) DefaultHttpContentProcessor(io.micronaut.http.server.netty.DefaultHttpContentProcessor) Internal(io.micronaut.core.annotation.Internal) ByteBufHolder(io.netty.buffer.ByteBufHolder) HttpContentProcessor(io.micronaut.http.server.netty.HttpContentProcessor) TypedSubscriber(io.micronaut.core.async.subscriber.TypedSubscriber) NonBlockingBodyArgumentBinder(io.micronaut.http.bind.binders.NonBlockingBodyArgumentBinder) MediaType(io.micronaut.http.MediaType) HttpData(io.netty.handler.codec.http.multipart.HttpData) Argument(io.micronaut.core.type.Argument) HttpRequest(io.micronaut.http.HttpRequest) BeanLocator(io.micronaut.context.BeanLocator) NettyHttpRequest(io.micronaut.http.server.netty.NettyHttpRequest) NettyHttpServer(io.micronaut.http.server.netty.NettyHttpServer) Logger(org.slf4j.Logger) MultipartBody(io.micronaut.http.server.multipart.MultipartBody) FileUpload(io.netty.handler.codec.http.multipart.FileUpload) HttpServerConfiguration(io.micronaut.http.server.HttpServerConfiguration) HttpContentSubscriberFactory(io.micronaut.http.server.netty.HttpContentSubscriberFactory) Attribute(io.netty.handler.codec.http.multipart.Attribute) AtomicLong(java.util.concurrent.atomic.AtomicLong) StreamedHttpRequest(io.micronaut.http.netty.stream.StreamedHttpRequest) EmptyByteBuf(io.netty.buffer.EmptyByteBuf) BeanProvider(io.micronaut.context.BeanProvider) Subscription(org.reactivestreams.Subscription) Optional(java.util.Optional) ConsumesMediaTypeQualifier(io.micronaut.web.router.qualifier.ConsumesMediaTypeQualifier) EmptyByteBuf(io.netty.buffer.EmptyByteBuf) Attribute(io.netty.handler.codec.http.multipart.Attribute) StreamedHttpRequest(io.micronaut.http.netty.stream.StreamedHttpRequest) AtomicLong(java.util.concurrent.atomic.AtomicLong) DefaultHttpContentProcessor(io.micronaut.http.server.netty.DefaultHttpContentProcessor) HttpData(io.netty.handler.codec.http.multipart.HttpData) ByteBufHolder(io.netty.buffer.ByteBufHolder) NettyHttpRequest(io.micronaut.http.server.netty.NettyHttpRequest) Subscription(org.reactivestreams.Subscription) TypedSubscriber(io.micronaut.core.async.subscriber.TypedSubscriber) FileUpload(io.netty.handler.codec.http.multipart.FileUpload)

Aggregations

NettyHttpRequest (io.micronaut.http.server.netty.NettyHttpRequest)13 StreamedHttpRequest (io.micronaut.http.netty.stream.StreamedHttpRequest)5 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)5 Internal (io.micronaut.core.annotation.Internal)4 HttpRequest (io.micronaut.http.HttpRequest)4 ByteBufHolder (io.netty.buffer.ByteBufHolder)4 Optional (java.util.Optional)4 Subscription (org.reactivestreams.Subscription)4 Logger (org.slf4j.Logger)4 LoggerFactory (org.slf4j.LoggerFactory)4 MutableHttpResponse (io.micronaut.http.MutableHttpResponse)3 HttpServerConfiguration (io.micronaut.http.server.HttpServerConfiguration)3 EmptyByteBuf (io.netty.buffer.EmptyByteBuf)3 NonNull (io.micronaut.core.annotation.NonNull)2 TypedSubscriber (io.micronaut.core.async.subscriber.TypedSubscriber)2 StringUtils (io.micronaut.core.util.StringUtils)2 HttpAttributes (io.micronaut.http.HttpAttributes)2 HttpMethod (io.micronaut.http.HttpMethod)2 HttpResponse (io.micronaut.http.HttpResponse)2 HttpStatus (io.micronaut.http.HttpStatus)2