Skip to content

HMSG example is missing required sid #708

@bengsparks

Description

@bengsparks

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions