Size Limit of camel header variable and property

。_饼干妹妹 提交于 2019-12-20 03:53:21

问题


I have to store the request xml in to database. I was using header variable to do that.

exchange.getIn().setHeader("inputRequestXml", body);

it was working for some files And I was getting below exception for some files, it seems like because of the file size.

 413 Request entity too large

So I have changed the implementation by using camel property, like below

exchange.setProperty("inputRequestXml", body);

Now I am not getting the exception. But I am afraid that will it handle the bigger files in actual PROD environment. So i want to know, What would be the size limit of header variable and property?


回答1:


Apache Camel has no limit on Headers and Properties. It is limited by Java heap size, as every other object.

Error you have posted is HTTP error, you are probably sending it over HTTP and remote server returned this error. Apache Camel translates Message#headers as HTTP headers and you have exceeded size limit configured on server.

See: Maximum on http header values?

Switching to Properties worked, because Properties are not tranferred over HTTP. You might be interested in endpoint options copyHeaders=false and headerFilterStrategy




回答2:


Exchange properties have no limit, its just a HashMap that stores key/values in the memory of the JVM.

Message headers is also just a HashMap, but headers are part of the message contract, and depending on which Camel components (transports) you use then these headers may be in use, eg HTTP headers, SOAP headers, JMS headers etc. And when so you may have header limitations that are caused by these transports.

You can find more details and it can be a good idea to read the free chapter 1 of the Camel in Action 2nd edition book which explains the important Camel concepts.



来源:https://stackoverflow.com/questions/47648202/size-limit-of-camel-header-variable-and-property

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!