Github user kgiusti commented on a diff in the pull request: https://github.com/apache/qpid-dispatch/pull/218#discussion_r151166644 --- Diff: doc/new-book/routing.adoc --- @@ -213,11 +213,30 @@ address { } ---- -`prefix`:: The address prefix. All messages that match this prefix will be distributed according to the distribution pattern you specify. +`prefix` | `pattern`:: The address or group of addresses to which the address settings should be applied. You can specify a prefix to match an exact address or segment of an address. Alternatively, you can specify a pattern to match an address using wildcards. + //tag::prefix-matching[] -The prefix can match either an exact address or a segment within an address that is delimited by either a `.` or `/` character. For example, the prefix `my_address` would match the address `my_address` as well as `my_address.1` and `my_address/1`. However, it would not match `my_address1`. +A _prefix_ matches either an exact address or a segment within an address that is delimited by either a `.` or `/` character. For example, the prefix `my_address` would match the address `my_address` as well as `my_address.1` and `my_address/1`. However, it would not match `my_address1`. //end::prefix-matching[] ++ +//tag::pattern-matching[] +A _pattern_ matches an address that corresponds to a pattern. A pattern is a sequence of words delimited by either a `.` or `/` character. You can use wildcard characters to represent a word. The `*` character matches exactly one word, and the `#` character matches any sequence of zero or more words. ++ +The following table shows some examples of address patterns: ++ +[cols="25,75"] +|=== +| This pattern... | Matches... +| `news` | `news` +| `news/*/sports` | `news/europe/sports` and `news/usa/sports`, but not `news` or `news/europe/fr/sports` +| `news/#` | `news`, `news/europe`, `news/usa`, `news/usa/sports` +|=== ++ +[NOTE] +==== +You can convert a `prefix` value to a `pattern` by appending `/\#` to it. For example, the prefix `a/b/c` is equivalent to the pattern `a/b/c/#`. +==== +//end::pattern-matching[] --- End diff -- Would it be possible to add an additional note to urge users to consistently use either '.' or '/' as the word separator and not mix both? IOW if using '/' don't use '.' in the address and vice versa?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org