如何在Mule上记录传入HTTP请求的IP地址

时间:2016-04-07 08:21:24

标签: http mule

我正在使用mule esb 3.7.1和最新的HTTP连接器。我有一个带有传入http连接器的流程;并且需要知道哪些IP地址正在发送请求。 我有mmc等 - 最简单的方法是什么? 已经查看了所有文档afaik并且没有提及。

2 个答案:

答案 0 :(得分:2)

Use the below logger statement to print the request IP address after HTTP inbound component

<logger doc:name="Logger" level="INFO" message="IP value --- #[message.inboundProperties.'http.remote.address']"></logger>

答案 1 :(得分:1)

The HTTP header property "http.remote.address" of the Mule message lets you identify the remote host for a HTTP request.

But you need to consider these:
1) In a typical client environment, the request calls may be routed from firewalls, reverse proxies etc and may reach Mule. In that case, the above HTTP header property might have your reverse Proxy IP address (you need to confirm this by testing this in a test environment)
2) If you want to monitor the http requests from different client IPs/hosts, then you need to use an external tool and route the calls to Mule (i.e. a front ending Load Balancer kind of tool which provides you these details).

Hope this helps!

Thank you,

Ananth Krishnan
www.app-integrators.com