[ 
https://issues.apache.org/jira/browse/ARTEMIS-2238?focusedWorklogId=189693&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-189693
 ]

ASF GitHub Bot logged work on ARTEMIS-2238:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Jan/19 21:07
            Start Date: 24/Jan/19 21:07
    Worklog Time Spent: 10m 
      Work Description: michaelandrepearce commented on pull request #2520: 
ARTEMIS-2238 Enhancement to queueQuery on producer
URL: https://github.com/apache/activemq-artemis/pull/2520#discussion_r250776531
 
 

 ##########
 File path: 
artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageProducer.java
 ##########
 @@ -533,6 +496,52 @@ private void doSendx(ActiveMQDestination destination,
       }
    }
 
+   private void checkDestination(ActiveMQDestination destination,
+                                 SimpleString address,
+                                 ClientSession clientSession) throws 
JMSException {
+      if (!connection.containsKnownDestination(address)) {
+         try {
+            ClientSession.AddressQuery query = 
clientSession.addressQuery(address);
+
+            if (!query.isExists()) {
+               checkQueue(destination, address, clientSession, query);
+            } else {
+               if (destination.isQueue()) {
+                  ClientSession.QueueQuery queueQuery = 
clientSession.queueQuery(address);
+                  if (!queueQuery.isExists()) {
+                     checkQueue(destination, address, clientSession, query);
+                  }
+               }
+
+               connection.addKnownDestination(address);
+            }
+         } catch (ActiveMQQueueExistsException e) {
+            // The queue was created by another client/admin between the query 
check and send create queue packet
+         } catch (ActiveMQException e) {
+            throw JMSExceptionHelper.convertFromActiveMQException(e);
+         }
+      }
+   }
+
+   private void checkQueue(ActiveMQDestination destination,
+                                SimpleString address,
+                                ClientSession clientSession,
+                                ClientSession.AddressQuery query) throws 
ActiveMQException, InvalidDestinationException {
+      if (destination.isQueue() && query.isAutoCreateQueues()) {
 
 Review comment:
   e.g. no point calling,          clientSession.createAddress(address, 
RoutingType.ANYCAST, true); 
   
   if its not allowed....
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 189693)
    Time Spent: 1h 40m  (was: 1.5h)

> JMS Producer queueQuery does not work when addressName != queueName
> -------------------------------------------------------------------
>
>                 Key: ARTEMIS-2238
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2238
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.6.4
>         Environment: this is a regression created at 
> f3ace6afd726dc8e3c1c58c76e3fad3d5cfa357d
>            Reporter: clebert suconic
>            Priority: Major
>             Fix For: 2.7.0, 2.6.5
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to