[ 
https://issues.apache.org/jira/browse/ARTEMIS-4767?focusedWorklogId=991370&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-991370
 ]

ASF GitHub Bot logged work on ARTEMIS-4767:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Nov/25 16:38
            Start Date: 12/Nov/25 16:38
    Worklog Time Spent: 10m 
      Work Description: jbertram commented on code in PR #6050:
URL: https://github.com/apache/activemq-artemis/pull/6050#discussion_r2519025572


##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionTest.java:
##########
@@ -1328,6 +1332,54 @@ public void 
testRedistributionToQueuesWhereNotAllMessagesMatch() throws Exceptio
       verifyReceiveAllInRange(10, 20, 2);
    }
 
+   @Test
+   public void testValidatedUserWithRedistribution() throws Exception {
+      final String USERNAME = "myUser";
+      final String PASSWORD = "myPass";
+      final String ROLE = "myRole";
+      SecurityConfiguration securityConfiguration = new 
SecurityConfiguration();
+      securityConfiguration.addUser(USERNAME, PASSWORD);
+      securityConfiguration.addRole(USERNAME, ROLE);
+      ActiveMQJAASSecurityManager securityManager = new 
ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), 
securityConfiguration);
+      servers[0].getConfiguration()
+         .setPopulateValidatedUser(true)
+         .setSecurityEnabled(true);
+      servers[0].setSecurityManager(securityManager);
+      servers[1].getConfiguration()
+         .setPopulateValidatedUser(true)
+         .setSecurityEnabled(true);
+      servers[1].setSecurityManager(securityManager);
+      setupCluster(MessageLoadBalancingType.ON_DEMAND);
+
+      startServers(0, 1);
+
+      Role role = new Role(ROLE, true, true, true, true, true, true, true, 
true, true, true, false, false);
+      Set<Role> roles = new HashSet<>();
+      roles.add(role);
+      servers[0].getSecurityRepository().addMatch("#", roles);
+      servers[1].getSecurityRepository().addMatch("#", roles);
+
+      setupSessionFactory(0, isNetty(), false, USERNAME, PASSWORD);
+      setupSessionFactory(1, isNetty(), false, USERNAME, PASSWORD);
+
+      createQueue(0, "queues.testaddress", "queue0", null, false, USERNAME, 
PASSWORD);
+      createQueue(1, "queues.testaddress", "queue0", null, false, USERNAME, 
PASSWORD);
+
+      waitForBindings(0, "queues.testaddress", 1, 0, true);
+      waitForBindings(1, "queues.testaddress", 1, 0, true);
+
+      waitForBindings(0, "queues.testaddress", 1, 0, false);
+      waitForBindings(1, "queues.testaddress", 1, 0, false);
+
+      send(0, "queues.testaddress", 1, false, null, USERNAME, PASSWORD);
+
+      addConsumer(1, 1, "queue0", null, true, USERNAME, PASSWORD);
+
+      ClientMessage m = consumers[1].consumer.receive();

Review Comment:
   Hmmm...Perhaps not. Most of the other explicit calls to `receive(int)` are 
using `5000` or `1000` so I'll use `1000` as well.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 991370)
    Time Spent: 50m  (was: 40m)

> Original JMSXUserID is lost on message redistribution
> -----------------------------------------------------
>
>                 Key: ARTEMIS-4767
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4767
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Clustering
>    Affects Versions: 2.33.0
>            Reporter: Michael Desmedt
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> when {{populate-validated-user}} is set to true, in a clustered configuration:
> if both the producer and the consumer are on the same broker, when a message 
> is sent with user1, consumed message contains property {{JMSXUserID:user1}}
> if the producer and the consumer are on different brokers in the same 
> cluster, when a message is sent with user1, the consumed message contains 
> property {{JMSXUserID:<value of <cluster-user>>}}
>  
> initial validated-user value is lost.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to