This commit is contained in:
Clebert Suconic 2020-05-28 16:38:26 -04:00
commit 8921bd4bbb
2 changed files with 19 additions and 1 deletions

View File

@ -1041,7 +1041,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
server.checkQueueCreationLimit(getUsername());
server.createSharedQueue(queueConfiguration);
server.createSharedQueue(queueConfiguration.setUser(getUsername()));
}
@Deprecated

View File

@ -25,6 +25,7 @@ import java.util.Random;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.postoffice.Binding;
import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
import org.apache.activemq.artemis.tests.util.JMSTestBase;
import org.junit.Before;
import org.junit.Test;
@ -68,6 +69,23 @@ public class SharedConsumerTest extends JMSTestBase {
}
}
@Test
public void sharedDurableSubUser() throws Exception {
try (JMSContext context = cf.createContext("foo", "bar")) {
context.createSharedDurableConsumer(topic1, "mySharedCon");
boolean found = false;
for (Binding binding : server.getPostOffice().getBindingsForAddress(SimpleString.toSimpleString(topic1.getTopicName())).getBindings()) {
found = true;
assertTrue(binding instanceof LocalQueueBinding);
assertEquals("mySharedCon", ((LocalQueueBinding)binding).getQueue().getName().toString());
assertNotNull(((LocalQueueBinding)binding).getQueue().getUser());
assertEquals("foo", ((LocalQueueBinding)binding).getQueue().getUser().toString());
}
assertTrue(found);
}
}
@Test
public void sharedDurableUnsubscribeNewTopic() throws Exception {
context = cf.createContext();