jbertram commented on code in PR #6038:
URL: https://github.com/apache/activemq-artemis/pull/6038#discussion_r2528792760


##########
docs/user-manual/wildcard-syntax.adoc:
##########
@@ -72,3 +72,13 @@ For that, the `<wildcard-addresses>` configuration tag is 
used.
 ----
 
 The example above shows the default configuration.
+
+[NOTE]
+====
+It is technically _possible_ to use `$` as a custom wildcard character, but it 
is not recommended for two main reasons:
+
+. The default value of `internal-naming-prefix` is `$.activemq.internal.` 
which includes a `$` character.
+While this value can be changed, doing so may cause problems if, for example, 
you have already created a cluster while the default value was in use.
+In this case the broker will have already created store-and-forward resources 
that will have to be renamed manually.
+. The MQTT protocol uses `$` for certain bits of functionality (e.g. shared 
subscriptions) and this cannot be changed so MQTT functionality would need to 
be completely avoided.

Review Comment:
   Noted.



##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/Match.java:
##########
@@ -65,14 +65,16 @@ public Match(final String match, final T value, final 
WildcardConfiguration wild
          // this is to match with what's documented
          actMatch = 
actMatch.replace(wildcardConfiguration.getDelimiterString() + 
wildcardConfiguration.getAnyWordsString(), 
wildcardConfiguration.getAnyWordsString());
          actMatch = actMatch.replace(Match.DOT, Match.DOT_REPLACEMENT);
-         actMatch = actMatch.replace(Match.DOLLAR, Match.DOLLAR_REPLACEMENT);
+         if (!wildcardConfiguration.contains(Match.DOLLAR)) {
+            actMatch = actMatch.replace(Match.DOLLAR, 
Match.DOLLAR_REPLACEMENT);
+         }
          actMatch = 
actMatch.replace(wildcardConfiguration.getSingleWordString(), 
String.format(WORD_WILDCARD_REPLACEMENT_FORMAT, 
Pattern.quote(wildcardConfiguration.getDelimiterString())));
 
          // this one has to be done by last as we are using .* and it could be 
replaced wrongly if delimiter is '.'
          actMatch = 
actMatch.replace(wildcardConfiguration.getAnyWordsString(), 
String.format(WILDCARD_CHILD_REPLACEMENT_FORMAT, 
Pattern.quote(wildcardConfiguration.getDelimiterString())));
       }
       // we need to anchor with eot to ensure we have a full match
-      pattern = Pattern.compile(actMatch + "$");
+      pattern = Pattern.compile(actMatch + DOLLAR);

Review Comment:
   Fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to