You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Louisa Frison (Jira)" <ji...@apache.org> on 2022/03/16 10:58:00 UTC

[jira] [Updated] (ARTEMIS-3725) Using durable topic subscriptions with FQQN, artemis-jms-client tries to create an already existing queue -> AMQ229019

     [ https://issues.apache.org/jira/browse/ARTEMIS-3725?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Louisa Frison updated ARTEMIS-3725:
-----------------------------------
    Description: 
I need to subscribe to an already existing multicast-queue and I tried that using the FQQN like this:

//PREPARATIONS: create a multicast-queue named queueNameThatAlreadyExists under the address {color:#172b4d}TESTADRESS{color}

_ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("[tcp://127].0.0.1:61616");_ 

_cf.setClientID("clientID");_ 

_Connection connection = cf.createConnection(); connection.start();_ 

_Session session = connection.createSession();_ 

_Topic topic = session.createTopic("TESTADRESS::queueNameThatAlreadyExists"); session.createDurableSubscriber(topic, "subscriptionName", null, false);_

This unfortunately triggers the following exception:

_Exception in thread "main" javax.jms.InvalidDestinationException: AMQ229019: Queue queueNameThatAlreadyExists already exists on address TESTADRESS at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:549) at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:443) at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.createQueue(ActiveMQSessionContext.java:821) at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.internalCreateQueue(ClientSessionImpl.java:2054) at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.createQueue(ClientSessionImpl.java:307) at org.apache.activemq.artemis.jms.client.ActiveMQSession.createQueue(ActiveMQSession.java:1274) at org.apache.activemq.artemis.jms.client.ActiveMQSession.createConsumer(ActiveMQSession.java:878) at org.apache.activemq.artemis.jms.client.ActiveMQSession.createDurableSubscriber(ActiveMQSession.java:598) at Main.main(Main.java:18) Caused by: ActiveMQQueueExistsException[errorType=QUEUE_EXISTS message=AMQ229019: Queue queueNameThatAlreadyExists already exists on address TESTADRESS] ... 9 more_

I debugged it a little and it seems like in here: [https://github.com/apache/activemq-artemis/blob/main/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java] I think starting from Line 872 lies the reason: the existence of the multicast queue gets checked with a queueQuery using a queuename of pattern clientID.subscriptionName, which of course does not exist and subsequently tries to create a queue with the queueName taken from the FQQN ... which does exist ...

  was:
I need to subscribe to an already existing multicast-queue and I tried that using the FQQN like this:

//PREPARATIONS: create a multicast-queue named queueNameThatAlreadyExists under the address {color:#172b4d}TESTADRESS{color}

 _ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("[tcp://127].0.0.1:61616"); cf.setClientID("clientID"); Connection connection = cf.createConnection(); connection.start(); Session session = connection.createSession(); Topic topic = session.createTopic("TESTADRESS::queueNameThatAlreadyExists"); session.createDurableSubscriber(topic, "subscriptionName", null, false);_

This unfortunately triggers the following exception:

_Exception in thread "main" javax.jms.InvalidDestinationException: AMQ229019: Queue queueNameThatAlreadyExists already exists on address TESTADRESS at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:549) at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:443) at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.createQueue(ActiveMQSessionContext.java:821) at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.internalCreateQueue(ClientSessionImpl.java:2054) at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.createQueue(ClientSessionImpl.java:307) at org.apache.activemq.artemis.jms.client.ActiveMQSession.createQueue(ActiveMQSession.java:1274) at org.apache.activemq.artemis.jms.client.ActiveMQSession.createConsumer(ActiveMQSession.java:878) at org.apache.activemq.artemis.jms.client.ActiveMQSession.createDurableSubscriber(ActiveMQSession.java:598) at Main.main(Main.java:18) Caused by: ActiveMQQueueExistsException[errorType=QUEUE_EXISTS message=AMQ229019: Queue queueNameThatAlreadyExists already exists on address TESTADRESS] ... 9 more_

I debugged it a little and it seems like in here: [https://github.com/apache/activemq-artemis/blob/main/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java] I think starting from Line 872 lies the reason: the existence of the multicast queue gets checked with a queueQuery using a queuename of pattern clientID.subscriptionName, which of course does not exist and subsequently tries to create a queue with the queueName taken from the FQQN ... which does exist ...


> Using durable topic subscriptions with FQQN, artemis-jms-client tries to create an already existing queue -> AMQ229019
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-3725
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3725
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: JMS
>    Affects Versions: 2.20.0
>            Reporter: Louisa Frison
>            Priority: Minor
>
> I need to subscribe to an already existing multicast-queue and I tried that using the FQQN like this:
> //PREPARATIONS: create a multicast-queue named queueNameThatAlreadyExists under the address {color:#172b4d}TESTADRESS{color}
> _ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("[tcp://127].0.0.1:61616");_ 
> _cf.setClientID("clientID");_ 
> _Connection connection = cf.createConnection(); connection.start();_ 
> _Session session = connection.createSession();_ 
> _Topic topic = session.createTopic("TESTADRESS::queueNameThatAlreadyExists"); session.createDurableSubscriber(topic, "subscriptionName", null, false);_
> This unfortunately triggers the following exception:
> _Exception in thread "main" javax.jms.InvalidDestinationException: AMQ229019: Queue queueNameThatAlreadyExists already exists on address TESTADRESS at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:549) at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:443) at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.createQueue(ActiveMQSessionContext.java:821) at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.internalCreateQueue(ClientSessionImpl.java:2054) at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.createQueue(ClientSessionImpl.java:307) at org.apache.activemq.artemis.jms.client.ActiveMQSession.createQueue(ActiveMQSession.java:1274) at org.apache.activemq.artemis.jms.client.ActiveMQSession.createConsumer(ActiveMQSession.java:878) at org.apache.activemq.artemis.jms.client.ActiveMQSession.createDurableSubscriber(ActiveMQSession.java:598) at Main.main(Main.java:18) Caused by: ActiveMQQueueExistsException[errorType=QUEUE_EXISTS message=AMQ229019: Queue queueNameThatAlreadyExists already exists on address TESTADRESS] ... 9 more_
> I debugged it a little and it seems like in here: [https://github.com/apache/activemq-artemis/blob/main/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java] I think starting from Line 872 lies the reason: the existence of the multicast queue gets checked with a queueQuery using a queuename of pattern clientID.subscriptionName, which of course does not exist and subsequently tries to create a queue with the queueName taken from the FQQN ... which does exist ...



--
This message was sent by Atlassian Jira
(v8.20.1#820001)