You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Matias Urbieta <ma...@fluxit.com.ar> on 2013/09/30 21:23:24 UTC

Injecting web service client ip in camel exchanges - a platform solution

Hi, i wonder if there is a way to inject in a camel context current cxf
endpoint's client  ip.
I could perform it by accessing  cxf message from a camel processor but the
solution is available for the route that declares the processor and it
would be great having it available as a platform feature.
The processor takes from cxf message accessed through camel's in message
header and then puts the value as a same message's header as can be seen
next:

 org.apache.cxf.message.Message cxfMessage =
exchange.getIn().getHeader(CxfConstants.CAMEL_CXF_MESSAGE,
org.apache.cxf.message.Message.class);
ServletRequest request = (ServletRequest) cxfMessage.get("HTTP.REQUEST");
 String remoteAddress = request.getRemoteAddr();
exchange.getIn().setHeader("REMOTE_IP", remoteAddress);

This feature allows me the relate any exchange with the server that
requests it.
If such feature is not present, should i extend servicemix's camel-cxf
component for providing client's ip injection?
Thanks in advance


-- 
Mario Matias Urbieta
matias.urbieta@fluxit.com.ar
www.fluxit.com.ar Calle 9 #865
La Plata / Buenos Aires / Argentina
Tel: +54 221 4275781 Int:308
Cel: +54 011 36814113