camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "abhijit.kulkarni" <>
Subject Restlet Route - Output payload truncated
Date Tue, 08 Apr 2014 12:26:24 GMT

I need urgent help regarding the output payload of a restlet being
I have a route 'ABC' which uses a restlet to accept a valid JSON from its
client (Android App) and calls another route 'XYZ' (using direct-vm
component), which is deployed as part of another bundle. This route 'XYZ'
calls an external URL using http4. At the end the route 'ABC' prepares an
output JSON and sends it back to the caller. For Some reason, somewhere the
content-length header is being set to 5 and hence the caller (Android App)
is able to read only the first 5 characters of a usually successful output

Note: I am using camel 2.10.7

Following are the routes that I have written for the reference. (Please
Note: I have removed the references from the route that are not necessary
for this discussion). 

<route id="ABC" autoStartup="true">
        <from uri="restlet:/sendAFreeMessage?restletMethods=GET,POST"/>
        <onException useOriginalMessage="true">
		<to uri="bean:myHandlerBeanName?method=generateFailureResponse"/> 
		<marshal ref="sendAFreeMsgResponse-to-json"/>
        <unmarshal ref="sendAFreeMsgRequest-to-pojo"/>
         ... Some Bean Endpoints for processing using the POJO (request) in
the Exchange Body have been removed ...
		        <simple>${property.AGGREGATOR-ID} == '1003'</simple> 
		        ...Call Separate Route for custom Processing for Brazil ...
		        <to uri="direct-vm:brazilSendAFreeMsg" />
        <to uri="bean:myHandlerBeanName?method=generateSuccessResponse"/> 
        <marshal ref="sendAFreeMsgResponse-to-json"/>

<route id="XYZ" autoStartup="true">
        <from uri="direct-vm:brazilSendAFreeMsg"/>
        <to uri="bean:anotherHandlerBean?method=generateMsgRequest" />
        ...Call External URL, We override the URI in generateMsgRequest to
correct URI ...
        <to uri="http4:HostName:PortNumber/ContextPath"/>
		        <simple>${header.camelhttpresponsecode} != '200'</simple>
		        ...Some Processing such as making DB entries etc...
		         ...Some Processing such as making DB entries etc...

The Json expected by the client is - 


and what the caller (Android App) sees is - 

For the reference I am also giving the HTTP request and Response Headers
printed from the caller (Android App) logs. 

Request Headers - 
Content-Type: application/json 
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Response Headers - 
Server: Restlet-Framework/2.0.15 
Content-Type: text/plain;charset=UTF-8 
Content-Length: 5 

I think the header Content-Length: 5 is the culprit here, don't know how
this has been set. 

Please let me know in case you need any further details. Please Help ! 


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message