You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Tarun.Bharti" <ta...@hotmail.com> on 2017/03/01 13:05:28 UTC

How to override Buffer size for httpclient when calling Rest web Service via Camel

When i send a rest Get request via camel its restricting the request URI size
to 2048 byte where i need to send a URI of 5000 byte. I debugged and found
camel is internally using Apache HTTPClient to send the send the request. Is
there any way to change the BufferedOutPutStream size of HTTPConnection to
pass a large byte data becuase when the size of request is exceeding 2048,
its not writing the request on OutPutStream hence returning 400 status code.
However when i use a DefaultHTTPClient of apache it has a buffersize of
8192.



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-override-Buffer-size-for-httpclient-when-calling-Rest-web-Service-via-Camel-tp5794628.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to override Buffer size for httpclient when calling Rest web Service via Camel

Posted by ankurkumar78 <an...@hotmail.com>.
I'm part of the same team. Apache Camel Version is 2.13.1

I think we are looking for configuring HttpClient Buffer Size in this case
through Camel



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-override-Buffer-size-for-httpclient-when-calling-Rest-web-Service-via-Camel-tp5794628p5794633.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to override Buffer size for httpclient when calling Rest web Service via Camel

Posted by "Tarun.Bharti" <ta...@hotmail.com>.
@Claus Ibsen-2 Can you please suggest any way to overcome this limitation ?



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-override-Buffer-size-for-httpclient-when-calling-Rest-web-Service-via-Camel-tp5794628p5794752.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to override Buffer size for httpclient when calling Rest web Service via Camel

Posted by "Tarun.Bharti" <ta...@hotmail.com>.
As ankur mentioned the camel version is 2.13.1 and currently i tried with
directly http by mentioning the URL in to() as shown below. Since we are
using apache CXF rest, i had also tried the same thing with cxfrs:bean but
it also ended up with exception.

 .choice()
               
.when(header(ReservationConstant.CALL_ENDECA_FOR_LAR_FACETS).isEqualTo(Boolean.TRUE))
                .setHeader(Exchange.HTTP_METHOD,
constant(org.apache.camel.component.http4.HttpMethods.GET))
                .setHeader(Exchange.HTTP_PATH,
constant(ReservationConstant.ENDECA_GUIDED_SEARCH_SERVICE))
                .setBody(simple(StringUtils.EMPTY))
               
//.to("cxfrs:bean:endecaLocationKeyRSClient?throwExceptionOnFailure=false")
                .to("{{service.endeca.location.dimension.rest}}")
                //.process(endecaFacetProcessor)
                .bean(EndecaResponseBuilder.class,
"getEndecaResponseForLARFacets")
                .end();



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-override-Buffer-size-for-httpclient-when-calling-Rest-web-Service-via-Camel-tp5794628p5794650.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to override Buffer size for httpclient when calling Rest web Service via Camel

Posted by Claus Ibsen <cl...@gmail.com>.
Can you tell more which CAmel version, which http / rest components you use etc.

On Wed, Mar 1, 2017 at 2:05 PM, Tarun.Bharti <ta...@hotmail.com> wrote:
> When i send a rest Get request via camel its restricting the request URI size
> to 2048 byte where i need to send a URI of 5000 byte. I debugged and found
> camel is internally using Apache HTTPClient to send the send the request. Is
> there any way to change the BufferedOutPutStream size of HTTPConnection to
> pass a large byte data becuase when the size of request is exceeding 2048,
> its not writing the request on OutPutStream hence returning 400 status code.
> However when i use a DefaultHTTPClient of apache it has a buffersize of
> 8192.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-override-Buffer-size-for-httpclient-when-calling-Rest-web-Service-via-Camel-tp5794628.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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