Class JsonStreamElementLimit

java.lang.Object
io.micronaut.http.netty.body.JsonStreamElementLimit

@Internal public final class JsonStreamElementLimit extends Object
Limit for the size of a single node of a streamed JSON body read by NettyJsonHandler.readChunked(Argument, MediaType, Headers, Publisher) or NettyJsonStreamHandler.readChunked(Argument, MediaType, Headers, Publisher). A node is buffered in memory before it is decoded.
Since:
5.2.21
  • Method Details

    • limit

      public static <T> reactor.core.publisher.Flux<T> limit(Publisher<T> publisher, long maxElementSize)
      Limit the size of every node of a publisher returned by a chunked JSON reader.
      Type Parameters:
      T - The element type
      Parameters:
      publisher - The publisher returned by the reader
      maxElementSize - The maximum size of a single node
      Returns:
      The limited publisher