This closes #3150
This commit is contained in:
commit
8921bd4bbb
|
@ -1041,7 +1041,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
||||||
|
|
||||||
server.checkQueueCreationLimit(getUsername());
|
server.checkQueueCreationLimit(getUsername());
|
||||||
|
|
||||||
server.createSharedQueue(queueConfiguration);
|
server.createSharedQueue(queueConfiguration.setUser(getUsername()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
|
|
@ -25,6 +25,7 @@ import java.util.Random;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.api.core.SimpleString;
|
import org.apache.activemq.artemis.api.core.SimpleString;
|
||||||
import org.apache.activemq.artemis.core.postoffice.Binding;
|
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.apache.activemq.artemis.tests.util.JMSTestBase;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
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
|
@Test
|
||||||
public void sharedDurableUnsubscribeNewTopic() throws Exception {
|
public void sharedDurableUnsubscribeNewTopic() throws Exception {
|
||||||
context = cf.createContext();
|
context = cf.createContext();
|
||||||
|
|
Loading…
Reference in New Issue