Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMSG example is missing required sid #708

Open
bengsparks opened this issue Jun 24, 2024 · 0 comments
Open

HMSG example is missing required sid #708

bengsparks opened this issue Jun 24, 2024 · 0 comments
Assignees

Comments

@bengsparks
Copy link

bengsparks commented Jun 24, 2024

The shorter HMSG example is seemingly incorrect.

The specified syntax is:
HMSG <subject> <sid> [reply-to] <#header bytes> <#total bytes>␍␊[headers]␍␊␍␊[payload]␍␊

When matching against the shorter example
HMSG FOO.BAR 34 45␍␊NATS/1.0␍␊FoodGroup: vegetable␍␊␍␊Hello World␍␊,
note that only the HMSG prefix and 3 values occur before the first ␍␊ marker, despite 4 values being the minimum required by the aforementioned syntax.

The following substitutions occur
<subject> := FOO.BAR
[reply-to] := <optional>
<#header bytes> := 34
<#total bytes> := 45

which leaves sid without a value despite being required.

Changing this example to
HMSG FOO.BAR BAZ.69 34 45␍␊NATS/1.0␍␊FoodGroup: vegetable␍␊␍␊Hello World␍␊
by inserting BAZ.69, would be an appropriate and simple fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants