Hi I am not sure if restlet can gzip automatic. But you can try to use the gzip data format in the end of your route, and then set the appropriate headers as you already do https://camel.apache.org/components/latest/gzipdeflater-dataformat.html
On Wed, Oct 2, 2019 at 6:42 PM bhavishya goyal <bhavishyago...@gmail.com> wrote: > > Hi, > > I have camel restlet component which send large data of around 500K records > in json. if i send without zip it take around 20 min. I though to zip my > response so i have include content encoding header like this but in this > case request is getting failed > > <get > uri="/getAnalyticsReport?synchronous=true&streamRepresentation=true" > bindingMode="off"> > <to uri="direct:analyticsReport" /> > > </get> > > <route id="analyticsReport"> > <from uri="direct:analyticsReport" /> > <bean ref="algo" method="fetchInstrumentValues" /> > <setHeader headerName="Exchange.CONTENT_ENCODING"> > <constant>gzip</constant> > </setHeader> > > </route> > > I tried with other way but still no success > > <route id="analyticsReport"> > <from uri="direct:analyticsReport" /> > <bean ref="algo" method="fetchInstrumentValues" /> > <setHeader headerName="Exchange.SKIP_GZIP_ENCODING"> > <constant>false</constant> > </setHeader> > <setHeader headerName="Exchange.HTTP_CHARACTER_ENCODING"> > <constant>UTF-8</constant> > </setHeader> > > > </route> > > my function returns string of json data. > > these are response header > > HTTP/1.1 200 OK Content-encoding: gzip Server: Restlet-Framework/2.2.1 > Access-control-allow-headers: > access-control-allow-methods,access-control-allow-origin,authorization,content-type > Breadcrumbid: ID-DESKTOP-CMAL9V7-58651-1570034356268-0-15 > Access-control-max-age: 3600 Date: Wed, 02 Oct 2019 16:40:19 GMT > Access-control-allow-methods: GET,PUT,POST,HEAD,OPTIONS Transfer-encoding: > chunked Content-type: text/plain Access-control-allow-origin: * > -- > Regards > Bhavishya Goyal -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2