Description
import org.apache.activemq.artemis.core.server.ServerConsumer; import org.apache.activemq.artemis.core.server.ServerSession; import org.apache.activemq.artemis.core.server.plugin.ActiveMQServerPlugin; public class AuthorPlugin implements ActiveMQServerPlugin { @Override public void registered(ActiveMQServer server) { } @Override public void afterCreateSession(ServerSession session) throws ActiveMQException { try { RemotingConnection connection = session.getRemotingConnection(); //通过nginx 代理 artemismq 获取到IP 是 nginx 的本地IP: 172.16.34.112 //如何才能获取到连接客户端的远程IP String remoteIp = connection.getRemoteAddress(); } catch (Exception e) { log.error(ExceptionUtils.getStackTrace(e)); } ActiveMQServerPlugin.super.afterCreateSession(session); }
ref:
Attachments
Issue Links
- duplicates
-
ARTEMIS-3915 Support Proxy protocol (HAProxy) on Artemis acceptors
- Closed