nats-architecture-and-design
nats-architecture-and-design copied to clipboard
Direct Message Multiple Values
Overview
Because of the way the server stacks values during republishes, the last value for each header field is the correct value for direct messages
Nats-Subject
Nats-Sequence
Nats-Last-Sequence
Nats-Time-Stamp
Nats-Stream
Clients and Tools
- [ ] Go @piotrpio
- [x] Java @scottf https://github.com/nats-io/nats.java/pull/1016 and https://github.com/nats-io/nats.java/pull/1099
- [X] JavaScript @aricart https://github.com/nats-io/nats.deno/issues/586
- [x] .Net @scottf https://github.com/nats-io/nats.net/pull/830 and https://github.com/nats-io/nats.net/pull/879
- [ ] C @levb
- [ ] Python @wallyqs
- [ ] Ruby @wallyqs
- [ ] Rust @Jarema @caspervonb
- [x] .Net V2 @mtmk https://github.com/nats-io/nats.net.v2/pull/512
Example Unit Test
- Create a stream with configuration:
name: "sbname"
subjects: "sub.>"
republish
src: ">"
dest: "$KV.sbname.>"
- Create a Key Value bucket with bucket name matching the stream name
name: "sbname"
- Publish 3 different ways for coverage
Connection Publish: Subject: "sub.1", Payload: "A"
JetStream Publish: Subject: "sub.2", Payload: "B"
Key Value Put to Bucket: Key: "sub.3", Value: "C"
- Retrieve values from the bucket.
KeyValueEntry kve1 = kv.get(publishSubject1);
assertEquals("sbname", kve1.getBucket());
assertEquals("sub.1", kve1.getKey());
assertEquals("A", kve1.getValueAsString());
KeyValueEntry kve2 = kv.get(publishSubject2);
assertEquals("sbname", kve2.getBucket());
assertEquals("sub.2", kve2.getKey());
assertEquals("B", kve2.getValueAsString());
KeyValueEntry kve3 = kv.get(publishSubject3);
assertEquals("sbname", kve3.getBucket());
assertEquals("sub.3", kve3.getKey());
assertEquals("C", kve3.getValueAsString());
Other Tasks
- [ ] docs.nats.io updated @bruth
- [ ] Update ADR to
Implemented
- [ ] Update client features spreadsheet
Client authors please update with your progress. If you open issues in your own repositories as a result of this request, please link them to this one by pasting the issue URL in a comment or main issue description.