You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2021/02/09 03:23:00 UTC

[jira] [Commented] (ARTEMIS-2943) Multicast Static filter for topics not working

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

Justin Bertram commented on ARTEMIS-2943:
-----------------------------------------

I will send a PR to fix the static-selector example because it is, in fact, broken as you noted.

However, the issue you're having setting a static filter on a mutlicast queue and using JMS topics comes down to how the address model in Artemis works. In short, everything is working as designed. 

What you seem to be missing is that when you use the JMS API to create a non-durable subscription on a topic what you get is a temporary, multicast queue with a randomly generated name. This queue is bound to the address with the same name as the topic. It is generally referred to as a "subscription queue" because it represents the JMS client's subscription. The subscriber will consume messages from this queue. 

To be clear, the _broker_ creates this queue in response to the JMS client's subscription. Therefore, any static filter you've configured in {{broker.xml}} won't apply. If you want to have a filter on this queue simply [define a selector when you create your subscription using the JMS API|https://docs.oracle.com/javaee/7/api/javax/jms/Session.html#createConsumer-javax.jms.Destination-java.lang.String-].

> Multicast Static filter for topics not working
> ----------------------------------------------
>
>                 Key: ARTEMIS-2943
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2943
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: AMQP, Tests
>            Reporter: Rajesh Reddy Kasala
>            Assignee: Justin Bertram
>            Priority: Major
>
> Steps to reproduce:
> examples/features/standard/static-selector
> When running above test,  NONE of the messages (of color 'red') are received. Test case should assert on receiving 'red' messages. As of it only asserts that non-red messages are not received.
> This works fine if we change queue type from multicast to anycast in broker.xml.
>  
> Static filter for Topics:
> But when i change the test case from createQueue() to createTopic(), and change exampleQueue with exampleTopic in all places like StaticSelectorExample.java, JNDI.properties and broker.xml ALL messages are received instaed of only 'red' messages.
>  
> Am i missing something ? How can i implement static filter on topics(multicast) ?
>  
> Note: i am running the test case from master branch :
> https://github.com/apache/activemq-artemis



--
This message was sent by Atlassian Jira
(v8.3.4#803005)