diff --git a/doc/adr/0004-nats-headers.md b/doc/adr/0004-nats-headers.md index ba8d5e9b..134fbc75 100644 --- a/doc/adr/0004-nats-headers.md +++ b/doc/adr/0004-nats-headers.md @@ -57,16 +57,16 @@ Messages that include a header have a `HPUB` protocol: ``` HPUB SUBJECT REPLY 23 30␍␊NATS/1.0␍␊Header: X␍␊␍␊PAYLOAD␍␊ HPUB SUBJECT REPLY 23 23␍␊NATS/1.0␍␊Header: X␍␊␍␊␍␊ +HPUB SUBJECT REPLY 48 55␍␊NATS/1.0␍␊Header1: X␍␊Header1: Y␍␊Header2: Z␍␊␍␊PAYLOAD␍␊ +HPUB SUBJECT REPLY 48 48␍␊NATS/1.0␍␊Header1: X␍␊Header1: Y␍␊Header2: Z␍␊␍␊␍␊ HPUB [REPLY]
- ``` #### NOTES: - -- `HDR_LEN` includes the entire serialized header -- `TOT_LEN` includes the entire payload length including the header +- `HDR_LEN` includes the entire serialized header, from the start of the version string up to and including the ␍␊ before the payload +- `TOT_LEN` the payload length plus the HDR_LEN ### MSG with Headers @@ -74,15 +74,16 @@ Clients will see `HMSG` protocol lines for `MSG`s that contain headers ``` HMSG SUBJECT 1 REPLY 23 30␍␊NATS/1.0␍␊Header: X␍␊␍␊PAYLOAD␍␊ -HPUB SUBJECT 1 REPLY 23 23␍␊NATS/1.0␍␊Header: X␍␊␍␊␍␊ +HMSG SUBJECT 1 REPLY 23 23␍␊NATS/1.0␍␊Header: X␍␊␍␊␍␊ +HMSG SUBJECT 1 REPLY 48 55␍␊NATS/1.0␍␊Header1: X␍␊Header1: Y␍␊Header2: Z␍␊␍␊PAYLOAD␍␊ +HMSG SUBJECT 1 REPLY 48 48␍␊NATS/1.0␍␊Header1: X␍␊Header1: Y␍␊Header2: Z␍␊␍␊␍␊ HMSG [REPLY] ``` -- `HDR_LEN` includes the entire header -- `TOT_LEN` includes the entire payload length including the header - +- `HDR_LEN` includes the entire serialized header, from the start of the version string up to and including the ␍␊ before the payload +- `TOT_LEN` the payload length plus the HDR_LEN ## Decision