You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sparktronics <sp...@gmail.com> on 2011/10/14 10:22:10 UTC

Reading HTTP Response codes from camel-http

hi there,

I'm a new user of camel and having trouble reading the http response code of
the camel-http component. It is basically that I am unable to get the
property from neither of the following(I'm using simple):

- ${out.headers.HTTP_RESPONSE_CODE}
- ${in.headers.HTTP_RESPONSE_CODE}
- ${property.HTTP_RESPONSE_CODE}

I'm using camel 2.4 and I'm reading the documentation in:
http://camel.apache.org/http.html

The code I'm using in Spring:

 <to uri="http://${some-provider-host}?throwExceptionOnFailure='false'"/>
			   
  <log  message="jiraConn-prov: log http response headers:
${property.HTTP_RESPONSE_CODE}"
          loggingLevel="INFO"
logName="${project.groupId}.${deployment-country}" />

Any help is welcomed.

Thanks,
Mario

--
View this message in context: http://camel.465427.n5.nabble.com/Reading-HTTP-Response-codes-from-camel-http-tp4901830p4901830.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Reading HTTP Response codes from camel-http

Posted by sparktronics <sp...@gmail.com>.
Thanks! It works now.

--
View this message in context: http://camel.465427.n5.nabble.com/Reading-HTTP-Response-codes-from-camel-http-tp4901830p4901999.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Reading HTTP Response codes from camel-http

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Mario,

Exchange.HTTP_RESPONSE_CODE is not the string it is just a constant. So 
you have to look into the Exchange class to see the actual string.
In this case it is
String HTTP_RESPONSE_CODE      = "CamelHttpResponseCode";

So you should try with :  ${property.CamelHttpResponseCode}

Christian


Am 14.10.2011 10:22, schrieb sparktronics:
> hi there,
>
> I'm a new user of camel and having trouble reading the http response code of
> the camel-http component. It is basically that I am unable to get the
> property from neither of the following(I'm using simple):
>
> - ${out.headers.HTTP_RESPONSE_CODE}
> - ${in.headers.HTTP_RESPONSE_CODE}
> - ${property.HTTP_RESPONSE_CODE}
>
> I'm using camel 2.4 and I'm reading the documentation in:
> http://camel.apache.org/http.html
>
> The code I'm using in Spring:
>
>   <to uri="http://${some-provider-host}?throwExceptionOnFailure='false'"/>
> 			
>    <log  message="jiraConn-prov: log http response headers:
> ${property.HTTP_RESPONSE_CODE}"
>            loggingLevel="INFO"
> logName="${project.groupId}.${deployment-country}" />
>
> Any help is welcomed.
>
> Thanks,
> Mario
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Reading-HTTP-Response-codes-from-camel-http-tp4901830p4901830.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com