Have you tried the 'chunkedMaxContentLength' setting? Looks like the
default is 1mb

http://camel.apache.org/netty4-http.html

Mary Cochran


Mary Cochran
Red Hat Consulting
mcoch...@redhat.com
(419) 543-0531

On Wed, Nov 29, 2017 at 10:02 AM, Mark <elihusma...@gmail.com> wrote:

> Sorry to be a pest, I still cannot figure out how to get the netty
> component to handle more than 1 MB.  I've tried all sorts of configuration
> options:
>
> restConfiguration()
> .component("netty4-http")
> .bindingMode(RestBindingMode.off)
> .contextPath("whatever")
> .componentProperty("chunkedMaxContentLength", String.valueOf( 8 * 1024 *
> 1024))
> .endpointProperty("chunkedMaxContentLength", String.valueOf( 8 * 1024 *
> 1024))
> .consumerProperty("chunkedMaxContentLength", String.valueOf( 8 * 1024 *
> 1024))
> .host("0.0.0.0")
> .port("{{port}}")
> ;
>
> After setting all of these properties I still can't upload more than a 1 MB
> file.  Does anyone know how I can properly configure the netty4-http
> component to support larger files ?
>
> Thanks,
> Mark
>
>
>
>
> On Tue, Nov 28, 2017 at 11:22 AM, Mark <elihusma...@gmail.com> wrote:
>
> > I am trying to create a Camel based REST endpoint that will need to
> > consume file uploads greater than the default 1 MB limit.  I created my
> > REST configuration using the following code:
> >
> > restConfiguration()
> >     .component("netty4-http")
> >     .bindingMode(RestBindingMode.off)
> >     .contextPath("whatever")
> >     .componentProperty("chunkedMaxContentLength", "8388608")
> >     .componentProperty("maxHeaderSize", "8388608")
> >     .host("0.0.0.0")
> >     .port("{{port}}")
> > ;
> >
> > Even when I send a file less than 8 MB and greater than 1 MB I still get
> > the exception:
> >
> > 2017-11-28 11:12:47,474 | WARN  | entExecutorGroup | NettyHttpConsumer
> >             | 267 - org.apache.camel.camel-netty4-http - 2.16.2 |
> > HttpServerChannelHandler is not found as attachment to handle exception,
> > send 404 back to the client.
> > io.netty.handler.codec.TooLongFrameException: HTTP content length
> > exceeded 1048576 bytes.
> > at io.netty.handler.codec.http.HttpObjectAggregator.decode(
> > HttpObjectAggregator.java:218)[255:io.netty.codec-http:4.0.41.Final]
> > at io.netty.handler.codec.http.HttpObjectAggregator.decode(
> > HttpObjectAggregator.java:57)[255:io.netty.codec-http:4.0.41.Final]
> > at io.netty.handler.codec.MessageToMessageDecoder.channelRead(
> > MessageToMessageDecoder.java:88)[287:io.netty.codec:4.0.41.Final]
> >
> >
> > Is there some other way that I'm supposed to be configuring the REST
> > endpoint or am I doing this wrong?  Secondly, should I use a different
> REST
> > component to get better performance out of large file uploading?
> >
> > Thanks in advance.
> >
> >
> >
>

Reply via email to