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

Lionel Cons commented on ARTEMIS-1933:
--------------------------------------

Here is the use case we have (simplified).

Several producers send messages to {{/queue/foo.a}}, {{/queue/foo.b}}... These 
behave like JMS queues and the last part of the name somehow indicate somehow 
the category of the message.

Some consumers want to read all the {{foo}} type messages so they subscribe to 
{{/queue/foo.*}} rather than subscribing to each individual queue. This is why 
we use wildcard subscriptions on queues. We have several wildcard subscriptions 
to load balance the message consumption.

Now the question is: what should the broker do when it has both an individual 
subscription on {{/queue/foo.a}} and a wildcard subscription on 
{{/queue/foo.*}}?

One could argue that we are talking about JMS queues so they should have a 
"deliver once" semantic so the messages sent to {{/queue/foo.a}} should be 
split between the two subscriptions.

In my tests, this is what ActiveMQ 5.x appears to be doing.

OTOH, Artemis seems to deliver the same message two times.

The ActiveMQ 5.x documentation you mention contains: "wildcards are not part of 
the JMS specification so are custom enhancements".

Since Artemis is pushed forward as being ActiveMQ's 5 successor, it would be 
good if they could implement wildcard subscriptions in a compatible way,

> Wildcard subscriptions deliver queue message multiple times (STOMP)
> -------------------------------------------------------------------
>
>                 Key: ARTEMIS-1933
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1933
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Lionel Cons
>            Priority: Major
>         Attachments: ARTEMIS-1933.text, broker.xml
>
>
> Here is the scenario (using STOMP):
>  - one subscription to {{/queue/test.foo}}
>  - one subscription to {{/queue/test.*}}
>  - one message sent to {{/queue/test.foo}}
> Since we are dealing with queues, the message should be load-balanced between 
> the two matching subscriptions so only one should get it. This is what 
> ActiveMQ 5 does.
> With Artemis, both subscriptions get the message.
> FWIW, I'm using {{default-address-routing-type}} to make sure destinations 
> starting with {{/queue/}} act like a queue (see ARTEMIS-1906).



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

Reply via email to