From 6bb09feed55a0ffcd53adbe55bc0b1a417c3d2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Baptiste=20Onofr=C3=A9?= Date: Tue, 3 Aug 2021 11:08:54 +0200 Subject: [PATCH] [AMQ-8138] Set client IP address with Stomp host header (cherry picked from commit 2e169f0bc3db3e16fe2928ac03b3308c69b5e72a) --- .../org/apache/activemq/transport/stomp/ProtocolConverter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java index 5cdbb8e209..1f6f9069d5 100644 --- a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java +++ b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java @@ -752,6 +752,7 @@ public class ProtocolConverter { String passcode = headers.get(Stomp.Headers.Connect.PASSCODE); String clientId = headers.get(Stomp.Headers.Connect.CLIENT_ID); String heartBeat = headers.get(Stomp.Headers.Connect.HEART_BEAT); + String host = headers.get(Stomp.Headers.Connect.HOST); if (heartBeat == null) { heartBeat = defaultHeartBeat; @@ -768,6 +769,7 @@ public class ProtocolConverter { } else { connectionInfo.setClientId("" + connectionInfo.getConnectionId().toString()); } + connectionInfo.setClientIp(host); connectionInfo.setResponseRequired(true); connectionInfo.setUserName(login);