使用Mule Ajax连接器,是否可以确定客户端的IP地址?
<ajax:inbound-endpoint channel="/services/testservice" connector-ref="AjaxConnector" responseTimeout="10000" doc:name="AJAX Test"/>
<logger message="#[What Would I put here to get me the client IP]" level="INFO" doc:name="Logger"/>
答案 0 :(得分:1)
我在源代码中没有看到任何相关规定:https://github.com/mulesoft/mule/tree/3.7.2/transports/ajax/src/main/java/org/mule/transport/ajax
我所能看到的是对名为ajax.cometd.client
的流变量的消息的添加,其中包含公开org.cometd.Client
方法的getId()
实例。这可能是一个不透明的ID,但它可能包含IP?
所以我认为答案是否定的。
答案 1 :(得分:1)
OMG,Mule使用的CometD版本比恐龙更老!
Mule基本上使用的是近10年前的版本0.x,当时CometD仍在org.mortbay.cometd
命名空间下。
从那时起,CometD毕业于org.cometd
命名空间下的一个独立项目。
CometD当前版本为3.x,当前的API确实有办法检索客户端的IP地址。
有人使用JIRA登录,请{Muleoft {/ 3}}。