camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "abhijit.kulkarni" <>
Subject Camel Restlet and HTTP 302
Date Fri, 18 Oct 2013 16:44:02 GMT

I have a route in camel which uses restlet component to receive GET requests
from the client (Android App). 
As part of this request, there are some query parameters I receive and based
on one of the parameter value I have to return different HTTP statuses back
to the service client. 
e.g. if the param value is 'A' then I return HTTP 200 with session Id set in
the body, and this works fine with the following (following is pseudocode in
Spring DSL and have omitted few sections irrelevant to this question). 
<route id="xyz">

I want to return HTTP 302 if the param value is 'B' so I have added another
<when> in the choice element as below - 
    <setHeader headerName="CamelHttpResponseCode">
    <setHeader headerName="Location">

Now coming to a problem area - When client (android app) calls this rest
service with param = 'B', it receives back the HTTP status as 302 but is
unable to redirect because it is unable to find the URL to redirect to.
After capturing the HTTP response in debug mode and printing the headers
received in the Android App, I realized that the 'Location' from the headers
list is missing (So obviously the Android App couldn't perform the

Am I doing something wrong ?  Am I setting the Location header correctly ? 

Camel Exchange class has various HTTP related constants, but did not find
any constant to be used to set the redirect url as a location in header. I
was expecting something similar to CamelHttpResponseCode for redirect
location such as CamelHttpResponseRedirectLocation or something like that :) 

Please help me .... 

Abhijit Kulkarni.  

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

View raw message