[
https://issues.apache.org/jira/browse/AMQ-6058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15315292#comment-15315292
]
Jonathan Malek commented on AMQ-6058:
-------------------------------------
We have some brokers (5.11.1) configured with {{prefix="\*.\*."}}. After the
upgrade to 5.13.3, I believe the change to shouldDispatch(...) is failing the
destination name check, and the result is that messages are not being
dispatched to the virtual topics.
A naive (but working) option would be to change the shouldDispatch(...) from:
bq. {{return prefix.contains(".\*") ? ...}}
to:
bq. {{return prefix.contains(".\*") && !prefix.startsWith("\*") ? ...}}
Which should satisfy both objectives: the original objective of AMQ-6058, and
the need to support virtual topics whose prefix starts with a wildcard.
> Certain VirtualTopic configurations send messages to the wrong queue
> --------------------------------------------------------------------
>
> Key: AMQ-6058
> URL: https://issues.apache.org/jira/browse/AMQ-6058
> Project: ActiveMQ
> Issue Type: Bug
> Components: Broker
> Affects Versions: 5.12.1
> Reporter: Christopher L. Shannon
> Assignee: Christopher L. Shannon
> Fix For: 5.13.0
>
>
> When testing out configurations of VirtualTopics I noticed some of the
> behavior doesn't seem quite right when using certain VirtualTopic set ups.
> Consider a VirtualTopic with the default name of {{>}} and a prefix called
> {{q.test.vt.*.}} Normally the desired behavior is to only forward messages
> to consumers with that prefix. For example, if a message is published to a
> topic called {{mytopic}}, then the consumer would be on queue
> {{q.test.vt.myconsumer.mytopic}}.
> However, I've noticed that based on the interceptor logic that uses the
> destination map to find matching destinations, if a higher level queue
> exists, such as {{q.test.>}} in this case, that queue will also receive the
> message.
> It seems desirable that only queues starting with the defined prefix should
> get the message so we should probably do a quick sanity check in the
> VirtualTopicInterceptor to make sure the destinations that match start with
> the VirtualTopic prefix defined.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)