Description
in our test suite, we have a test than ensures that when a JMS topic is removed (destroyed), all its states is removed from the server side (including the queues of its durable subscribers).
The test consists in:
1. create a jms topic
2. create a durable subscriber (but do not start its connection so no message are consumed)
3. send a message on the topic
4. destroy the topic
=> done by calling JMSServerControl.destroyTopic(name, true)
5. recreate the topic
6. recreate the durable subscriber and try to consume a message
=> it should not consume the message sent before the topic was destroyed.
However from time to time, we have intermitted failure at step 6 with the exception:
javax.jms.InvalidDestinationException: AMQ119018: Binding already exists LocalQueueBinding [address=jms.topic.JMSTopicManagementTestCase1438051842862, queue=QueueImpl[name=consumer.removeJMSTopicRemovesAllMessages, postOffice=PostOfficeImpl [server=ActiveMQServerImpl::serverUUID=265f6d63-34d3-11e5-afab-c1b85251bbf1]]@efd130, filter=null, name=consumer.removeJMSTopicRemovesAllMessages, clusterName=consumer.removeJMSTopicRemovesAllMessages265f6d63-34d3-11e5-afab-c1b85251bbf1] at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:410) at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.createQueue(ActiveMQSessionContext.java:578) at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.internalCreateQueue(ClientSessionImpl.java:1734) at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.createQueue(ClientSessionImpl.java:281) at org.apache.activemq.artemis.core.client.impl.DelegatingSession.createQueue(DelegatingSession.java:298) at org.apache.activemq.artemis.jms.client.ActiveMQSession.createConsumer(ActiveMQSession.java:797) at org.apache.activemq.artemis.jms.client.ActiveMQSession.createDurableSubscriber(ActiveMQSession.java:477) at org.apache.activemq.artemis.jms.client.ActiveMQSession.createDurableSubscriber(ActiveMQSession.java:447) at org.jboss.as.test.integration.messaging.mgmt.JMSTopicManagementTestCase.removeJMSTopicRemovesAllMessages(JMSTopicManagementTestCase.java:423)
It looks like the binding for the durable consumers has not been removed when JMSServerControl.destroyTopic(name, true) is called at step 4.
It's intermittent and happens only on our CI which is slower than my dev machine.