[
https://issues.apache.org/jira/browse/ARTEMIS-4767?focusedWorklogId=991338&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-991338
]
ASF GitHub Bot logged work on ARTEMIS-4767:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 12/Nov/25 15:31
Start Date: 12/Nov/25 15:31
Worklog Time Spent: 10m
Work Description: jbertram commented on code in PR #6050:
URL: https://github.com/apache/activemq-artemis/pull/6050#discussion_r2518656151
##########
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:
Agreed!
Issue Time Tracking
-------------------
Worklog Id: (was: 991338)
Time Spent: 0.5h (was: 20m)
> 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: 0.5h
> 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