[ 
https://issues.apache.org/jira/browse/ARTEMIS-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17762767#comment-17762767
 ] 

Damien Picard commented on ARTEMIS-4416:
----------------------------------------

 

In this file 
[ActiveMQSession.java|https://github.com/apache/activemq-artemis/blob/91debf25dbf0f3924d511ee615c6f9b0545e2a5f/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java#L413C12-L440C14],
 _checkDestination_ function: 
{code:java}
            // Second we create the queue, the address would have existed or 
successfully created.
            if (destination.isQueue()) {
               ClientSession.QueueQuery queueQuery = 
session.queueQuery(address);
               if (!queueQuery.isExists()) {
                  if (addressQuery.isAutoCreateQueues()) {
                     if (destination.isTemporary()) {
                        createTemporaryQueue(destination, RoutingType.ANYCAST, 
address, null, addressQuery);
                     } else {
                        createQueue(destination, RoutingType.ANYCAST, address, 
null, true, true, addressQuery);
                     }
                  } else {
                     throw new InvalidDestinationException("Destination " + 
address + " does not exist, address exists but autoCreateQueues=" + 
addressQuery.isAutoCreateQueues());
                  }
               }
            } else if (CompositeAddress.isFullyQualified(address)) { // it 
could be a topic using FQQN
               ClientSession.QueueQuery queueQuery = 
session.queueQuery(address);
               if (!queueQuery.isExists()) {
                  if (addressQuery.isAutoCreateQueues()) {
                     if (destination.isTemporary()) {
                        createTemporaryQueue(destination, 
RoutingType.MULTICAST, address, null, addressQuery);
                     } else {
                        createQueue(destination, RoutingType.MULTICAST, 
address, null, true, true, addressQuery);
                     }
                  } else {
                     throw new InvalidDestinationException("Destination " + 
address + " does not exist, address exists but autoCreateQueues=" + 
addressQuery.isAutoCreateQueues());
                  }
               }
            } {code}
 

When we don't use a fully qualified address (FQQN), I don't understand why the 
client needs to check if the queue exists. It's the server's responsibility to 
forward the message to the correct queue, if the queue doesn't exist, it will 
send the message to DLQ or elsewhere.

 

> Client can't use anycast without FQQN
> -------------------------------------
>
>                 Key: ARTEMIS-4416
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4416
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.7.0, 2.28.0
>            Reporter: Damien Picard
>            Priority: Major
>
> Since artemis-jms-client@2.7.0, it's no longer possible to create an 
> ActiveMQQueue object with an address (only FQQN). 
> Use case:
> 1. We have an address with one or more queues (declare with an anycast 
> router).
> 2. We create filters to distribute our messages to the correct queue
> 3. A producer sends a message to an address and the server is responsible for 
> forwarding it to the correct queue.
> This use case works in 2.6.4. Since 2.7.0, we have an error raised by the 
> "checkDestination" method ("Destination xxx does not exist, address exists 
> but autoCreateQueues=false").
> ActiveMQ Artemis lets you do this, but the client prevents it.
> If we're using ActiveMQTopic, it works exclusively in multicast mode, so the 
> above use case doesn't work either.
> Also, we could use FQQN exclusively, but we didn't design our architecture 
> that way.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to