Hi

Ah yeah looks like the code should be identical for those 2 (or maybe
just one common method as its InputStream as input).
And then they should check the camel context for stream caching in use
or not. Then you can turn it on|off on context level and have it work.

Can you create a new JIRA ticket

On Wed, Apr 1, 2020 at 11:06 AM Vojtech Fried <[email protected]> wrote:
>
> Hi,
>
> I am trying to fix upload of huge files via camel rest endpoint. The problem 
> is that stream caching enables itself in this case (without being enabled in 
> camel context or the route), but when camel asks a StreamCachingStrategy if 
> the data should be moved from memory to file, it always says no, because it 
> has "enabled" flag false (because no one enabled stream caching).
>
> There is a Jira issue https://issues.apache.org/jira/browse/CAMEL-8821 that 
> should have fixed it, but it actually did not, because as the last comment 
> says, it calls a wrong method "readResponse..." instead of "readRequest...", 
> the fix is only in "readRequest..." method. So I think it should be reopened.
>
> Is there any other way how to disable stream caching?
>
> My code is in configure method in a class that extends RouteBuilder:
>
> restConfiguration()
>             .contextPath(...)
>             .enableCORS(true)
>             .component("servlet")
> rest("...")
>             .id("...")
>             .produces("application/json")
>             .post("...")
>             .to("direct:...");
>
> Vojtech



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to