This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch activemq-5.16.x
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/activemq-5.16.x by this push:
     new 7295bd8  [AMQ-8043] Do not override JMSXUserID when message comes 
across network connector
7295bd8 is described below

commit 7295bd85a54c658aeee5052aea72369fb9ebd21e
Author: Matt Pavlovich <[email protected]>
AuthorDate: Fri Dec 24 10:37:17 2021 -0600

    [AMQ-8043] Do not override JMSXUserID when message comes across network 
connector
    
    (cherry picked from commit bec734a133ef27327414f1fb75066d01b4bd039a)
---
 .../src/main/java/org/apache/activemq/broker/UserIDBroker.java        | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/activemq-broker/src/main/java/org/apache/activemq/broker/UserIDBroker.java 
b/activemq-broker/src/main/java/org/apache/activemq/broker/UserIDBroker.java
index 2d5dea5..56c432c 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/UserIDBroker.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/UserIDBroker.java
@@ -37,6 +37,10 @@ public class UserIDBroker extends BrokerFilter {
 
     public void send(ProducerBrokerExchange producerExchange, Message 
messageSend) throws Exception {
         final ConnectionContext context = 
producerExchange.getConnectionContext();
+        if(context.isNetworkConnection() && messageSend.getUserID() != null) {
+            super.send(producerExchange, messageSend);
+            return;
+        }
         String userID = context.getUserName();
         if (isUseAuthenticatePrincipal()) {
             SecurityContext securityContext = context.getSecurityContext();

Reply via email to