Search in sources :

Example 1 with StreamedHttpRequest

use of io.micronaut.http.netty.stream.StreamedHttpRequest in project micronaut-core by micronaut-projects.

the class DefaultHttpClient method prepareHttpHeaders.

private <I> void prepareHttpHeaders(URI requestURI, io.micronaut.http.HttpRequest<I> request, io.netty.handler.codec.http.HttpRequest nettyRequest, boolean permitsBody, boolean closeConnection) {
    HttpHeaders headers = nettyRequest.headers();
    if (!headers.contains(HttpHeaderNames.HOST)) {
        headers.set(HttpHeaderNames.HOST, getHostHeader(requestURI));
    }
    // HTTP/2 assumes keep-alive connections
    if (httpVersion != io.micronaut.http.HttpVersion.HTTP_2_0) {
        if (closeConnection) {
            headers.set(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE);
        } else {
            headers.set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
        }
    }
    if (permitsBody) {
        Optional<I> body = request.getBody();
        if (body.isPresent()) {
            if (!headers.contains(HttpHeaderNames.CONTENT_TYPE)) {
                MediaType mediaType = request.getContentType().orElse(MediaType.APPLICATION_JSON_TYPE);
                headers.set(HttpHeaderNames.CONTENT_TYPE, mediaType);
            }
            if (nettyRequest instanceof FullHttpRequest) {
                FullHttpRequest fullHttpRequest = (FullHttpRequest) nettyRequest;
                headers.set(HttpHeaderNames.CONTENT_LENGTH, fullHttpRequest.content().readableBytes());
            } else {
                if (!headers.contains(HttpHeaderNames.CONTENT_LENGTH) && !headers.contains(HttpHeaderNames.TRANSFER_ENCODING)) {
                    headers.set(HttpHeaderNames.TRANSFER_ENCODING, HttpHeaderValues.CHUNKED);
                }
            }
        } else if (!(nettyRequest instanceof StreamedHttpRequest)) {
            headers.set(HttpHeaderNames.CONTENT_LENGTH, 0);
        }
    }
}
Also used : StreamedHttpRequest(io.micronaut.http.netty.stream.StreamedHttpRequest) NettyHttpHeaders(io.micronaut.http.netty.NettyHttpHeaders) MutableHttpHeaders(io.micronaut.http.MutableHttpHeaders) URI(java.net.URI) MediaType(io.micronaut.http.MediaType)

Example 2 with StreamedHttpRequest

use of io.micronaut.http.netty.stream.StreamedHttpRequest in project micronaut-core by micronaut-projects.

the class HttpRequestDecoder method decode.

@Override
protected void decode(ChannelHandlerContext ctx, HttpRequest msg, List<Object> out) {
    if (LOG.isTraceEnabled()) {
        LOG.trace("Server {}:{} Received Request: {} {}", embeddedServer.getHost(), embeddedServer.getPort(), msg.method(), msg.uri());
    }
    try {
        NettyHttpRequest<Object> request = new NettyHttpRequest<>(msg, ctx, conversionService, configuration);
        if (httpRequestReceivedEventPublisher != ApplicationEventPublisher.NO_OP) {
            try {
                ctx.executor().execute(() -> {
                    try {
                        httpRequestReceivedEventPublisher.publishEvent(new HttpRequestReceivedEvent(request));
                    } catch (Exception e) {
                        if (LOG.isErrorEnabled()) {
                            LOG.error("Error publishing Http request received event: " + e.getMessage(), e);
                        }
                    }
                });
            } catch (Exception e) {
                if (LOG.isErrorEnabled()) {
                    LOG.error("Error publishing Http request received event: " + e.getMessage(), e);
                }
            }
        }
        out.add(request);
    } catch (IllegalArgumentException e) {
        // this configured the request in the channel as an attribute
        new NettyHttpRequest<>(new DefaultHttpRequest(msg.protocolVersion(), msg.method(), "/"), ctx, conversionService, configuration);
        final Throwable cause = e.getCause();
        ctx.fireExceptionCaught(cause != null ? cause : e);
        if (msg instanceof StreamedHttpRequest) {
            // discard any data that may come in
            ((StreamedHttpRequest) msg).closeIfNoSubscriber();
        }
    }
}
Also used : StreamedHttpRequest(io.micronaut.http.netty.stream.StreamedHttpRequest) HttpRequestReceivedEvent(io.micronaut.http.context.event.HttpRequestReceivedEvent) DefaultHttpRequest(io.netty.handler.codec.http.DefaultHttpRequest) NettyHttpRequest(io.micronaut.http.server.netty.NettyHttpRequest)

Example 3 with StreamedHttpRequest

use of io.micronaut.http.netty.stream.StreamedHttpRequest in project micronaut-core by micronaut-projects.

the class CompletableFutureBodyBinder method bind.

@Override
public BindingResult<CompletableFuture> bind(ArgumentConversionContext<CompletableFuture> context, HttpRequest<?> source) {
    if (source instanceof NettyHttpRequest) {
        NettyHttpRequest nettyHttpRequest = (NettyHttpRequest) source;
        io.netty.handler.codec.http.HttpRequest nativeRequest = ((NettyHttpRequest) source).getNativeRequest();
        if (nativeRequest instanceof StreamedHttpRequest) {
            CompletableFuture future = new CompletableFuture();
            Argument<?> targetType = context.getFirstTypeVariable().orElse(Argument.OBJECT_ARGUMENT);
            HttpContentProcessor<?> processor = httpContentProcessorResolver.resolve(nettyHttpRequest, targetType);
            processor.subscribe(new CompletionAwareSubscriber<Object>() {

                @Override
                protected void doOnSubscribe(Subscription subscription) {
                    subscription.request(1);
                }

                @Override
                protected void doOnNext(Object message) {
                    if (message instanceof ByteBufHolder) {
                        nettyHttpRequest.addContent((ByteBufHolder) message);
                    } else {
                        nettyHttpRequest.setBody(message);
                    }
                    subscription.request(1);
                }

                @Override
                protected void doOnError(Throwable t) {
                    future.completeExceptionally(t);
                }

                @Override
                protected void doOnComplete() {
                    Optional<Argument<?>> firstTypeParameter = context.getFirstTypeVariable();
                    if (firstTypeParameter.isPresent()) {
                        Argument<?> arg = firstTypeParameter.get();
                        Optional converted = nettyHttpRequest.getBody(arg);
                        if (converted.isPresent()) {
                            future.complete(converted.get());
                        } else {
                            future.completeExceptionally(new IllegalArgumentException("Cannot bind body to argument type: " + arg.getType().getName()));
                        }
                    } else {
                        future.complete(nettyHttpRequest.getBody().orElse(null));
                    }
                }
            });
            return () -> Optional.of(future);
        } else {
            return BindingResult.EMPTY;
        }
    } else {
        return BindingResult.EMPTY;
    }
}
Also used : Optional(java.util.Optional) Argument(io.micronaut.core.type.Argument) StreamedHttpRequest(io.micronaut.http.netty.stream.StreamedHttpRequest) CompletableFuture(java.util.concurrent.CompletableFuture) ByteBufHolder(io.netty.buffer.ByteBufHolder) NettyHttpRequest(io.micronaut.http.server.netty.NettyHttpRequest) Subscription(org.reactivestreams.Subscription)

Example 4 with StreamedHttpRequest

use of io.micronaut.http.netty.stream.StreamedHttpRequest 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)

Example 5 with StreamedHttpRequest

use of io.micronaut.http.netty.stream.StreamedHttpRequest in project micronaut-core by micronaut-projects.

the class RoutingInBoundHandler method writeFinalNettyResponse.

private void writeFinalNettyResponse(MutableHttpResponse<?> message, HttpRequest<?> request, ChannelHandlerContext context) {
    HttpStatus httpStatus = message.status();
    final io.micronaut.http.HttpVersion httpVersion = request.getHttpVersion();
    final boolean isHttp2 = httpVersion == io.micronaut.http.HttpVersion.HTTP_2_0;
    boolean decodeError = request instanceof NettyHttpRequest && ((NettyHttpRequest<?>) request).getNativeRequest().decoderResult().isFailure();
    final Object body = message.body();
    if (body instanceof NettyCustomizableResponseTypeHandlerInvoker) {
        // default Connection header if not set explicitly
        if (!isHttp2) {
            if (!message.getHeaders().contains(HttpHeaders.CONNECTION)) {
                if (!decodeError && (httpStatus.getCode() < 500 || serverConfiguration.isKeepAliveOnServerError())) {
                    message.getHeaders().set(HttpHeaders.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                } else {
                    message.getHeaders().set(HttpHeaders.CONNECTION, HttpHeaderValues.CLOSE);
                }
            }
        }
        NettyCustomizableResponseTypeHandlerInvoker handler = (NettyCustomizableResponseTypeHandlerInvoker) body;
        message.body(null);
        handler.invoke(request, message, context);
    } else {
        io.netty.handler.codec.http.HttpResponse nettyResponse = NettyHttpResponseBuilder.toHttpResponse(message);
        io.netty.handler.codec.http.HttpHeaders nettyHeaders = nettyResponse.headers();
        // default Connection header if not set explicitly
        if (!isHttp2) {
            if (!nettyHeaders.contains(HttpHeaderNames.CONNECTION)) {
                boolean expectKeepAlive = nettyResponse.protocolVersion().isKeepAliveDefault() || request.getHeaders().isKeepAlive();
                if (!decodeError && (expectKeepAlive || httpStatus.getCode() < 500 || serverConfiguration.isKeepAliveOnServerError())) {
                    nettyHeaders.set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
                } else {
                    nettyHeaders.set(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE);
                }
            }
        }
        // default to Transfer-Encoding: chunked if Content-Length not set or not already set
        if (!nettyHeaders.contains(HttpHeaderNames.CONTENT_LENGTH) && !nettyHeaders.contains(HttpHeaderNames.TRANSFER_ENCODING)) {
            nettyHeaders.set(HttpHeaderNames.TRANSFER_ENCODING, HttpHeaderValues.CHUNKED);
        }
        // close handled by HttpServerKeepAliveHandler
        final NettyHttpRequest<?> nettyHttpRequest = (NettyHttpRequest<?>) request;
        if (isHttp2) {
            addHttp2StreamHeader(request, nettyResponse);
        }
        io.netty.handler.codec.http.HttpRequest nativeRequest = nettyHttpRequest.getNativeRequest();
        GenericFutureListener<Future<? super Void>> requestCompletor = future -> {
            try {
                if (!future.isSuccess()) {
                    final Throwable throwable = future.cause();
                    if (!(throwable instanceof ClosedChannelException)) {
                        if (throwable instanceof Http2Exception.StreamException) {
                            Http2Exception.StreamException se = (Http2Exception.StreamException) throwable;
                            if (se.error() == Http2Error.STREAM_CLOSED) {
                                // ignore
                                return;
                            }
                        }
                        if (LOG.isErrorEnabled()) {
                            LOG.error("Error writing final response: " + throwable.getMessage(), throwable);
                        }
                    }
                }
            } finally {
                cleanupRequest(context, nettyHttpRequest);
                context.read();
            }
        };
        if (nativeRequest instanceof StreamedHttpRequest && !((StreamedHttpRequest) nativeRequest).isConsumed()) {
            StreamedHttpRequest streamedHttpRequest = (StreamedHttpRequest) nativeRequest;
            // We have to clear the buffer of FlowControlHandler before writing the response
            // If this is a streamed request and there is still content to consume then subscribe
            // and write the buffer is empty.
            // noinspection ReactiveStreamsSubscriberImplementation
            streamedHttpRequest.subscribe(new Subscriber<HttpContent>() {

                private Subscription streamSub;

                @Override
                public void onSubscribe(Subscription s) {
                    streamSub = s;
                    s.request(1);
                }

                @Override
                public void onNext(HttpContent httpContent) {
                    httpContent.release();
                    streamSub.request(1);
                }

                @Override
                public void onError(Throwable t) {
                    syncWriteAndFlushNettyResponse(context, request, nettyResponse, requestCompletor);
                }

                @Override
                public void onComplete() {
                    syncWriteAndFlushNettyResponse(context, request, nettyResponse, requestCompletor);
                }
            });
        } else {
            syncWriteAndFlushNettyResponse(context, request, nettyResponse, requestCompletor);
        }
    }
}
Also used : Publishers(io.micronaut.core.async.publisher.Publishers) HttpRequestTerminatedEvent(io.micronaut.http.context.event.HttpRequestTerminatedEvent) HttpHeaders(io.micronaut.http.HttpHeaders) Internal(io.micronaut.core.annotation.Internal) NettyStreamedFileCustomizableResponseType(io.micronaut.http.server.netty.types.files.NettyStreamedFileCustomizableResponseType) ByteBufHolder(io.netty.buffer.ByteBufHolder) HttpStatus(io.micronaut.http.HttpStatus) IdleState(io.netty.handler.timeout.IdleState) NettySystemFileCustomizableResponseType(io.micronaut.http.server.netty.types.files.NettySystemFileCustomizableResponseType) NettyPartData(io.micronaut.http.server.netty.multipart.NettyPartData) TextPlainCodec(io.micronaut.runtime.http.codec.TextPlainCodec) IdleStateEvent(io.netty.handler.timeout.IdleStateEvent) Set(java.util.Set) RequestArgumentSatisfier(io.micronaut.http.server.binding.RequestArgumentSatisfier) SSLException(javax.net.ssl.SSLException) RouteInfo(io.micronaut.web.router.RouteInfo) Writable(io.micronaut.core.io.Writable) Body(io.micronaut.http.annotation.Body) DefaultFullHttpResponse(io.netty.handler.codec.http.DefaultFullHttpResponse) Http2Error(io.netty.handler.codec.http2.Http2Error) InternalServerException(io.micronaut.http.server.exceptions.InternalServerException) RouteMatch(io.micronaut.web.router.RouteMatch) NettyByteBufferFactory(io.micronaut.buffer.netty.NettyByteBufferFactory) NettyMutableHttpResponse(io.micronaut.http.netty.NettyMutableHttpResponse) MonoSink(reactor.core.publisher.MonoSink) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) UriRouteMatch(io.micronaut.web.router.UriRouteMatch) HttpData(io.netty.handler.codec.http.multipart.HttpData) Nullable(io.micronaut.core.annotation.Nullable) DuplicateRouteException(io.micronaut.web.router.exceptions.DuplicateRouteException) BiConsumer(java.util.function.BiConsumer) ByteBuffer(io.micronaut.core.io.buffer.ByteBuffer) Argument(io.micronaut.core.type.Argument) HttpRequest(io.micronaut.http.HttpRequest) ConversionService(io.micronaut.core.convert.ConversionService) ServerRequestContext(io.micronaut.http.context.ServerRequestContext) ErrorResponseProcessor(io.micronaut.http.server.exceptions.response.ErrorResponseProcessor) MediaTypeCodecRegistry(io.micronaut.http.codec.MediaTypeCodecRegistry) HttpContent(io.netty.handler.codec.http.HttpContent) FileUpload(io.netty.handler.codec.http.multipart.FileUpload) ClosedChannelException(java.nio.channels.ClosedChannelException) Publisher(org.reactivestreams.Publisher) Mono(reactor.core.publisher.Mono) IOException(java.io.IOException) NettyHttpResponseBuilder(io.micronaut.http.netty.NettyHttpResponseBuilder) File(java.io.File) AbstractNettyHttpRequest(io.micronaut.http.netty.AbstractNettyHttpRequest) DefaultHttpContent(io.netty.handler.codec.http.DefaultHttpContent) Flux(reactor.core.publisher.Flux) AtomicLong(java.util.concurrent.atomic.AtomicLong) Paths(java.nio.file.Paths) SimpleChannelInboundHandler(io.netty.channel.SimpleChannelInboundHandler) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) Future(io.netty.util.concurrent.Future) RouteExecutor(io.micronaut.http.server.RouteExecutor) Sinks(reactor.core.publisher.Sinks) StreamingFileUpload(io.micronaut.http.multipart.StreamingFileUpload) URL(java.net.URL) URISyntaxException(java.net.URISyntaxException) LoggerFactory(org.slf4j.LoggerFactory) NettyHttpServerConfiguration(io.micronaut.http.server.netty.configuration.NettyHttpServerConfiguration) FileCustomizableResponseType(io.micronaut.http.server.types.files.FileCustomizableResponseType) Unpooled(io.netty.buffer.Unpooled) CompletionAwareSubscriber(io.micronaut.core.async.subscriber.CompletionAwareSubscriber) PartData(io.micronaut.http.multipart.PartData) NettyCustomizableResponseTypeHandler(io.micronaut.http.server.netty.types.NettyCustomizableResponseTypeHandler) StaticResourceResolver(io.micronaut.web.router.resource.StaticResourceResolver) MediaType(io.micronaut.http.MediaType) Http2Exception(io.netty.handler.codec.http2.Http2Exception) ReferenceCounted(io.micronaut.core.io.buffer.ReferenceCounted) HttpResponse(io.micronaut.http.HttpResponse) ClassUtils(io.micronaut.core.reflect.ClassUtils) Collection(java.util.Collection) MethodBasedRouteMatch(io.micronaut.web.router.MethodBasedRouteMatch) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) MutableHttpResponse(io.micronaut.http.MutableHttpResponse) MutableHttpHeaders(io.micronaut.http.MutableHttpHeaders) NettyCustomizableResponseTypeHandlerRegistry(io.micronaut.http.server.netty.types.NettyCustomizableResponseTypeHandlerRegistry) TooLongFrameException(io.netty.handler.codec.TooLongFrameException) HttpResponseStatus(io.netty.handler.codec.http.HttpResponseStatus) Collectors(java.util.stream.Collectors) ByteBufOutputStream(io.netty.buffer.ByteBufOutputStream) Attribute(io.netty.handler.codec.http.multipart.Attribute) StreamedHttpRequest(io.micronaut.http.netty.stream.StreamedHttpRequest) DecoderResult(io.netty.handler.codec.DecoderResult) List(java.util.List) DefaultHttpHeaders(io.netty.handler.codec.http.DefaultHttpHeaders) Optional(java.util.Optional) HttpAttributes(io.micronaut.http.HttpAttributes) Pattern(java.util.regex.Pattern) HttpVersion(io.netty.handler.codec.http.HttpVersion) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AtomicReference(java.util.concurrent.atomic.AtomicReference) Sharable(io.netty.channel.ChannelHandler.Sharable) LastHttpContent(io.netty.handler.codec.http.LastHttpContent) HashSet(java.util.HashSet) ErrorContext(io.micronaut.http.server.exceptions.response.ErrorContext) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) ByteBuf(io.netty.buffer.ByteBuf) Subscriber(org.reactivestreams.Subscriber) ExecutorService(java.util.concurrent.ExecutorService) HttpMethod(io.micronaut.http.HttpMethod) MediaTypeCodec(io.micronaut.http.codec.MediaTypeCodec) Logger(org.slf4j.Logger) HttpHeaderValues(io.netty.handler.codec.http.HttpHeaderValues) ApplicationEventPublisher(io.micronaut.context.event.ApplicationEventPublisher) GenericFutureListener(io.netty.util.concurrent.GenericFutureListener) NettyStreamingFileUpload(io.micronaut.http.server.netty.multipart.NettyStreamingFileUpload) LongConsumer(java.util.function.LongConsumer) NonNull(io.micronaut.core.annotation.NonNull) CollectionUtils(io.micronaut.core.util.CollectionUtils) Subscription(org.reactivestreams.Subscription) Router(io.micronaut.web.router.Router) Collections(java.util.Collections) JsonSubscriber(io.micronaut.http.netty.stream.JsonSubscriber) Http2Exception(io.netty.handler.codec.http2.Http2Exception) Subscription(org.reactivestreams.Subscription) ClosedChannelException(java.nio.channels.ClosedChannelException) HttpStatus(io.micronaut.http.HttpStatus) StreamedHttpRequest(io.micronaut.http.netty.stream.StreamedHttpRequest) Future(io.netty.util.concurrent.Future) AbstractNettyHttpRequest(io.micronaut.http.netty.AbstractNettyHttpRequest) HttpContent(io.netty.handler.codec.http.HttpContent) DefaultHttpContent(io.netty.handler.codec.http.DefaultHttpContent) LastHttpContent(io.netty.handler.codec.http.LastHttpContent)

Aggregations

StreamedHttpRequest (io.micronaut.http.netty.stream.StreamedHttpRequest)8 NettyHttpRequest (io.micronaut.http.server.netty.NettyHttpRequest)5 ByteBufHolder (io.netty.buffer.ByteBufHolder)5 Subscription (org.reactivestreams.Subscription)5 Internal (io.micronaut.core.annotation.Internal)3 Argument (io.micronaut.core.type.Argument)3 MediaType (io.micronaut.http.MediaType)3 EmptyByteBuf (io.netty.buffer.EmptyByteBuf)3 Optional (java.util.Optional)3 TypedSubscriber (io.micronaut.core.async.subscriber.TypedSubscriber)2 HttpRequest (io.micronaut.http.HttpRequest)2 HttpContentProcessor (io.micronaut.http.server.netty.HttpContentProcessor)2 ByteBuf (io.netty.buffer.ByteBuf)2 Attribute (io.netty.handler.codec.http.multipart.Attribute)2 FileUpload (io.netty.handler.codec.http.multipart.FileUpload)2 HttpData (io.netty.handler.codec.http.multipart.HttpData)2 ReferenceCounted (io.netty.util.ReferenceCounted)2 IOException (java.io.IOException)2 AtomicLong (java.util.concurrent.atomic.AtomicLong)2 Logger (org.slf4j.Logger)2