From afc279705fbb00acf6bc090f7d16de3db6701eb4 Mon Sep 17 00:00:00 2001 From: scottf Date: Thu, 13 May 2021 14:35:30 -0400 Subject: [PATCH 1/4] 0006-protocol-naming-conventions --- doc/adr/0006-protocol-naming-conventions.md | 56 +++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 doc/adr/0006-protocol-naming-conventions.md diff --git a/doc/adr/0006-protocol-naming-conventions.md b/doc/adr/0006-protocol-naming-conventions.md new file mode 100644 index 00000000..dab20455 --- /dev/null +++ b/doc/adr/0006-protocol-naming-conventions.md @@ -0,0 +1,56 @@ +# 6. protocol-naming-conventions + +Date: 2021-05-08 + +## Status + +Under Review + +## Context + +This document describes naming conventions for these protocol components: + +* message subject +* stream name +* reply to +* queue name +* durable name +* account name + +## Prior Work + +Currently the NATS Docs regarding [protocol convention](https://docs.nats.io/nats-protocol/nats-protocol#protocol-conventions) says this: + +> 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.: +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. + +## Specification + +``` +dot = "." +asterisk = "*" +lt = "<" +gt = ">" +dollar = "$" +colon = ":" +double-quote = ["] +fwd-slash = "/" +backslash = "\" +pipe = "|" +question-mark = "?" +ampersand = "&" +printable = all printable ascii (33 to 126 inclusive) +term = (printable except dot, asterisk or gt)+ +prefix = (printable except dot, asterisk, gt or dollar)+ +filename-safe = (printable except dot, asterisk, lt, gt, colon, double-quote, fwd-slash, backslash, pipe, question-mark, ampersand) + +message-subject = term (dot term | asterisk)* (dot gt)? +reply-to = term (dot term)* +stream-name = term +queue-name = term +durable-name = term +jetstream-prefix = prefix +account-name = (filename-safe)+ maximum 255 characters +``` From 808f7305b8e980eb601445a919a2c3e9f8e0b25b Mon Sep 17 00:00:00 2001 From: scottf Date: Thu, 13 May 2021 15:54:36 -0400 Subject: [PATCH 2/4] changed as per pr comments --- doc/adr/0006-protocol-naming-conventions.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/adr/0006-protocol-naming-conventions.md b/doc/adr/0006-protocol-naming-conventions.md index dab20455..ecf47c16 100644 --- a/doc/adr/0006-protocol-naming-conventions.md +++ b/doc/adr/0006-protocol-naming-conventions.md @@ -10,12 +10,10 @@ Under Review This document describes naming conventions for these protocol components: -* message subject -* stream name -* reply to -* queue name -* durable name -* account name +* Subjects (including Reply Subjects) +* Stream Names +* Consumer Names +* Account Names ## Prior Work From 511db9ef19e28195d5ffdd4e6f822f2c514730b2 Mon Sep 17 00:00:00 2001 From: scottf Date: Thu, 13 May 2021 16:11:48 -0400 Subject: [PATCH 3/4] clarifying js prefixes --- doc/adr/0006-protocol-naming-conventions.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/adr/0006-protocol-naming-conventions.md b/doc/adr/0006-protocol-naming-conventions.md index ecf47c16..025029fd 100644 --- a/doc/adr/0006-protocol-naming-conventions.md +++ b/doc/adr/0006-protocol-naming-conventions.md @@ -44,11 +44,12 @@ term = (printable except dot, asterisk or gt)+ prefix = (printable except dot, asterisk, gt or dollar)+ filename-safe = (printable except dot, asterisk, lt, gt, colon, double-quote, fwd-slash, backslash, pipe, question-mark, ampersand) -message-subject = term (dot term | asterisk)* (dot gt)? -reply-to = term (dot term)* -stream-name = term -queue-name = term -durable-name = term -jetstream-prefix = prefix -account-name = (filename-safe)+ maximum 255 characters +message-subject = term (dot term | asterisk)* (dot gt)? +reply-to = term (dot term)* +stream-name = term +queue-name = term +durable-name = term +js-internal-prefix = dollar (prefix dot)+ +js-user-prefix = (prefix dot)+ +account-name = (filename-safe)+ maximum 255 characters ``` From e63062027c39f1b1e049bc622a98559e381cc791 Mon Sep 17 00:00:00 2001 From: Scott Fauerbach Date: Fri, 18 Jun 2021 10:10:47 -0400 Subject: [PATCH 4/4] Prepare for acceptance --- doc/adr/0006-protocol-naming-conventions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/adr/0006-protocol-naming-conventions.md b/doc/adr/0006-protocol-naming-conventions.md index 025029fd..02f4f9a5 100644 --- a/doc/adr/0006-protocol-naming-conventions.md +++ b/doc/adr/0006-protocol-naming-conventions.md @@ -1,10 +1,10 @@ # 6. protocol-naming-conventions -Date: 2021-05-08 +Date: 2021-06-28 ## Status -Under Review +Accepted ## Context