mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
Merge pull request #31 from nats-io/update-subject-names
Update nats-protocol.md
This commit is contained in:
commit
9566ae2cbc
@ -14,12 +14,14 @@ The NATS server implements a [zero allocation byte parser](https://youtu.be/ylRK
|
|||||||
|
|
||||||
**Newlines**: NATS uses `CR` followed by `LF` (`CR+LF`, `\r\n`, `0x0D0A`) to terminate protocol messages. This newline sequence is also used to mark the end of the message payload in a `PUB` or `MSG` protocol message.
|
**Newlines**: NATS uses `CR` followed by `LF` (`CR+LF`, `\r\n`, `0x0D0A`) to terminate protocol messages. This newline sequence is also used to mark the end of the message payload in a `PUB` or `MSG` protocol message.
|
||||||
|
|
||||||
**Subject names**: Subject names, including reply subject (INBOX) names, are case-sensitive and must be non-empty alphanumeric strings with no embedded whitespace, and optionally token-delimited using the dot character (`.`), e.g.:
|
**Subject names**: Subject names, including reply subject (INBOX) names, are case-sensitive and must be non-empty alphanumeric strings with no embedded whitespace. All ascii alphanumeric characters except spaces/tabs and separators which are "." and ">" are allowed. Subject names can be optionally token-delimited using the dot character (`.`), e.g.:
|
||||||
|
|
||||||
`FOO`, `BAR`, `foo.bar`, `foo.BAR`, `FOO.BAR` and `FOO.BAR.BAZ` are all valid subject names
|
`FOO`, `BAR`, `foo.bar`, `foo.BAR`, `FOO.BAR` and `FOO.BAR.BAZ` are all valid subject names
|
||||||
|
|
||||||
`FOO. BAR`, `foo. .bar` and`foo..bar` are *not* valid subject names
|
`FOO. BAR`, `foo. .bar` and`foo..bar` are *not* valid subject names
|
||||||
|
|
||||||
|
A subject is comprised of 1 or more tokens. Tokens are separated by "." and can be any non space ascii alphanumeric character. The full wildcard token ">" is only valid as the last token and matches all tokens past that point. A token wildcard, "*" matches any token in the position it was listed. Wildcard tokens should only be used in a wildcard capacity and not part of a literal token.
|
||||||
|
|
||||||
**Character Encoding**: Subject names should be ascii characters for maximum interoperability. Due to language constraints and performance, some clients may support UTF-8 subject names, as may the server. No guarantees of non-ASCII support are provided.
|
**Character Encoding**: Subject names should be ascii characters for maximum interoperability. Due to language constraints and performance, some clients may support UTF-8 subject names, as may the server. No guarantees of non-ASCII support are provided.
|
||||||
|
|
||||||
**Wildcards**: NATS supports the use of wildcards in subject subscriptions.
|
**Wildcards**: NATS supports the use of wildcards in subject subscriptions.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user