Search in sources :

Example 81 with Binding

use of org.apache.activemq.artemis.core.postoffice.Binding in project activemq-artemis by apache.

the class SharedConsumerTest method sharedNonDurableUnsubscribeDifferentTopic.

@Test
public void sharedNonDurableUnsubscribeDifferentTopic() throws Exception {
    context = cf.createContext();
    try {
        JMSConsumer con1 = context.createSharedConsumer(topic1, "mySharedCon");
        JMSConsumer con2 = context.createSharedConsumer(topic1, "mySharedCon");
        con1.close();
        Binding binding = server.getPostOffice().getBinding(new SimpleString("nonDurable.mySharedCon"));
        assertNotNull(binding);
        con2.close();
        binding = server.getPostOffice().getBinding(new SimpleString("nonDurable.mySharedCon"));
        assertNull(binding);
        con1 = context.createSharedConsumer(topic2, "mySharedCon");
    } finally {
        context.close();
    }
}
Also used : Binding(org.apache.activemq.artemis.core.postoffice.Binding) JMSConsumer(javax.jms.JMSConsumer) SimpleString(org.apache.activemq.artemis.api.core.SimpleString) Test(org.junit.Test)

Aggregations

Binding (org.apache.activemq.artemis.core.postoffice.Binding)81 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)52 LocalQueueBinding (org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding)29 QueueBinding (org.apache.activemq.artemis.core.postoffice.QueueBinding)28 Test (org.junit.Test)25 Bindings (org.apache.activemq.artemis.core.postoffice.Bindings)24 Queue (org.apache.activemq.artemis.core.server.Queue)24 ClientSession (org.apache.activemq.artemis.api.core.client.ClientSession)18 RemoteQueueBinding (org.apache.activemq.artemis.core.server.cluster.RemoteQueueBinding)17 ArrayList (java.util.ArrayList)12 Filter (org.apache.activemq.artemis.core.filter.Filter)10 DivertBinding (org.apache.activemq.artemis.core.postoffice.impl.DivertBinding)10 ClientMessage (org.apache.activemq.artemis.api.core.client.ClientMessage)9 ClientProducer (org.apache.activemq.artemis.api.core.client.ClientProducer)9 Map (java.util.Map)8 CountDownLatch (java.util.concurrent.CountDownLatch)8 QueueQueryResult (org.apache.activemq.artemis.core.server.QueueQueryResult)8 ActiveMQException (org.apache.activemq.artemis.api.core.ActiveMQException)7 PostOffice (org.apache.activemq.artemis.core.postoffice.PostOffice)7 ActiveMQServer (org.apache.activemq.artemis.core.server.ActiveMQServer)7