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.