From 0de28c17df0b640442c2949e545ddd247aa4fe1a Mon Sep 17 00:00:00 2001 From: Matthias Hanel Date: Mon, 3 Feb 2020 20:24:42 -0500 Subject: [PATCH] Adding a subject example with a mix of wildcards Signed-off-by: Matthias Hanel --- nats-concepts/subjects.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nats-concepts/subjects.md b/nats-concepts/subjects.md index 57dfbeb..dc8634b 100644 --- a/nats-concepts/subjects.md +++ b/nats-concepts/subjects.md @@ -1,6 +1,6 @@ # Subject-Based Messaging -Fundamentally NATS is about publishing and listening for messages. Both of these depend heavily on _Subjects_ which scope messages into streams or topics. At its simplest, a subject is just a string of characters that form a name the publisher and subscriber can use to find each other. +Fundamentally, NATS is about publishing and listening for messages. Both of these depend heavily on _Subjects_ which scope messages into streams or topics. At its simplest, a subject is just a string of characters that form a name the publisher and subscriber can use to find each other. ![](../.gitbook/assets/subjects1.svg) @@ -38,3 +38,6 @@ The second wildcard is `>` which will match one or more tokens, and can only app Subject to your security configuration, wildcards can be used for monitoring by creating something sometimes called a _wire tap_. In the simplest case you can create a subscriber for `>`. This application will receive all messages -- again, subject to security settings -- sent on your NATS cluster. +### Mix Wildcards + +The wildcard `*` can appear multiple times in the same subject. Both types be used as well. For example, `*.*.*.>` will receive `time.us.east.atlanta` as it is at least 4 tokens long. \ No newline at end of file