How can I get the remote connection IP address from the camel-cxf consumer ?Page added by willem jiangHow can I get the remote connection IP address from the camel-cxf consumer ?From Camel 2.6.0, you can access the CXF Message by using the key of CamelCxfMessage from message header, and you can get the ServletRequest instance from the CXF message, then you can get the remote connection IP easily. // check the remote IP from the CXF Message 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 = equest.getRemoteAddr();
Change Notification Preferences
View Online
|
Add Comment
|