2015-04-27 17:32:30 -04:00
|
|
|
# Understanding the Apache ActiveMQ Artemis Wildcard Syntax
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2015-04-27 17:32:30 -04:00
|
|
|
Apache ActiveMQ Artemis uses a specific syntax for representing wildcards in security
|
2014-12-04 10:25:29 -05:00
|
|
|
settings, address settings and when creating consumers.
|
|
|
|
|
2017-12-22 16:25:21 -05:00
|
|
|
The syntax is similar to that used by [AMQP](https://www.amqp.org).
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2015-04-27 17:32:30 -04:00
|
|
|
An Apache ActiveMQ Artemis wildcard expression contains words delimited by the character
|
2014-12-04 10:25:29 -05:00
|
|
|
'`.`' (full stop).
|
|
|
|
|
|
|
|
The special characters '`#`' and '`*`' also have special meaning and can
|
|
|
|
take the place of a word.
|
|
|
|
|
|
|
|
The character '`#`' means 'match any sequence of zero or more words'.
|
|
|
|
|
|
|
|
The character '`*`' means 'match a single word'.
|
|
|
|
|
|
|
|
So the wildcard 'news.europe.\#' would match 'news.europe',
|
|
|
|
'news.europe.sport', 'news.europe.politics', and
|
|
|
|
'news.europe.politics.regional' but would not match 'news.usa',
|
|
|
|
'news.usa.sport' nor 'entertainment'.
|
|
|
|
|
|
|
|
The wildcard 'news.\*' would match 'news.europe', but not
|
|
|
|
'news.europe.sport'.
|
|
|
|
|
|
|
|
The wildcard 'news.\*.sport' would match 'news.europe.sport' and also
|
|
|
|
'news.usa.sport', but not 'news.europe.politics'.
|
2016-12-23 06:02:30 -05:00
|
|
|
|
|
|
|
## Configuring Wildcard syntax
|
|
|
|
|
|
|
|
It's possible to further configure the syntax of the wildcard addresses using the broker configuration.
|
|
|
|
For that, the `<wildcard-addresses>` configuration tag is used.
|
|
|
|
|
|
|
|
<wildcard-addresses>
|
2017-09-14 20:24:09 -04:00
|
|
|
<routing-enabled>true</routing-enabled>
|
2016-12-23 06:02:30 -05:00
|
|
|
<delimiter>.</delimiter>
|
|
|
|
<any-words>#</any-words>
|
|
|
|
<single-word>*</single-word>
|
|
|
|
</wildcard-addresses>
|
|
|
|
|
|
|
|
The example above shows the default configuration.
|