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

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

                Author: ASF GitHub Bot
            Created on: 07/Jun/23 14:45
            Start Date: 07/Jun/23 14:45
    Worklog Time Spent: 10m 
      Work Description: gemmellr commented on code in PR #4502:
URL: https://github.com/apache/activemq-artemis/pull/4502#discussion_r1221728080


##########
artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQSession.java:
##########
@@ -928,6 +917,35 @@ private ActiveMQMessageConsumer createConsumer(final 
ActiveMQDestination dest,
       }
    }
 
+   private SimpleString createFullyQualifedNamedQueue(ActiveMQDestination dest,
+                                        SimpleString coreFilterString,
+                                        AddressQuery response) throws 
ActiveMQException, JMSException {
+      SimpleString queueName;
+      queueName = CompositeAddress.extractQueueName(dest.getSimpleAddress());
+      if (!response.isExists() || 
!response.getQueueNames().contains(AutoCreateUtil.getCoreQueueName(session, 
dest.getSimpleAddress()))) {
+         if (response.isAutoCreateQueues()) {
+            try {
+               createQueue(dest, RoutingType.MULTICAST, 
dest.getSimpleAddress(), coreFilterString, true, true, response);
+            } catch (ActiveMQQueueExistsException e) {
+               // The queue was created by another client/admin between the 
query check and send create queue packet
+            }
+         } else {
+            throw new InvalidDestinationException("Destination " + 
dest.getName() + " does not exist");
+         }
+      } else {
+         QueueQuery queueQuery = session.queueQuery(queueName);
+
+         if (!queueQuery.isExists()) {
+            throw new InvalidDestinationException("Destination " + queueName + 
" does not exist");
+         }
+
+         if (coreFilterString != null && 
!queueQuery.getFilterString().equals(coreFilterString)) {

Review Comment:
   You changed it further by actually adding the reverse-check, so that this 
seems to be saying that if you have a queue with a filter defined on it, you 
can attach a 'normal consumer' without a filter to that queue...but you cant 
connect an 'FQQN consumer' to that same queue unless it has a filter defined? 
If thats true it seems a bit weird.





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

    Worklog Id:     (was: 864211)
    Time Spent: 3h  (was: 2h 50m)

> JMS consumer + FQQN + selector not working
> ------------------------------------------
>
>                 Key: ARTEMIS-4259
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4259
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> The CORE protocol does not honor consumers with a filter when used on FQQN 
> topics.
> Steps to reproduce:
> Start a consumer using CLI:
> {noformat}
> ./artemis consumer --url tcp://localhost:61616 --destination 
> topic://topic1::topic1.queue1 --protocol=core --message-count 1 --filter 
> "foo='bar'" --verbose{noformat}
> Send a message without the filter string:
> {noformat}
> ./artemis producer --url tcp://localhost:61616 --destination 
> topic://topic1::topic1.queue1 --protocol=core --message-count 1 --message 
> "some text"{noformat}
> You can observe the CORE client consuming the message which does not contain 
> the filter String:
> {noformat}
> Connection brokerURL = tcp://localhost:61616
> Consumer:: filter = foo='bar'
> Consumer ActiveMQTopic[topic1::topic1.queue1], thread=0 wait until 1 messages 
> are consumed
> Consumer ActiveMQTopic[topic1::topic1.queue1], thread=0 Received some text
> JMS Message ID:ID:a00cbea3-dda7-11ed-9c2d-b42e99ea6f5c
> Received text sized at 9
> Consumer ActiveMQTopic[topic1::topic1.queue1], thread=0 Consumed: 1 messages
> Consumer ActiveMQTopic[topic1::topic1.queue1], thread=0 Elapsed time in 
> second : 8 s
> Consumer ActiveMQTopic[topic1::topic1.queue1], thread=0 Elapsed time in milli 
> second : 8140 milli seconds
> Consumer ActiveMQTopic[topic1::topic1.queue1], thread=0 Consumed: 1 messages
> Consumer ActiveMQTopic[topic1::topic1.queue1], thread=0 Consumer thread 
> finished{noformat}



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

Reply via email to