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

Direct Message Multiple Values #250

Open
4 of 12 tasks
scottf opened this issue Oct 18, 2023 · 0 comments
Open
4 of 12 tasks

Direct Message Multiple Values #250

scottf opened this issue Oct 18, 2023 · 0 comments
Labels
client Client related work enhancement New feature or request

Comments

@scottf
Copy link
Collaborator

scottf commented Oct 18, 2023

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

Example Unit Test

  1. Create a stream with configuration:
name: "sbname"
subjects: "sub.>"
republish 
    src: ">" 
    dest: "$KV.sbname.>"
  1. Create a Key Value bucket with bucket name matching the stream name
name: "sbname"
  1. 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"
  1. 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.

@scottf scottf added enhancement New feature or request client Client related work labels Oct 18, 2023
@ripienaar ripienaar removed their assignment Oct 18, 2023
@aricart aricart removed their assignment Oct 24, 2023
@scottf scottf removed their assignment Nov 3, 2023
@scottf scottf changed the title Direct Message Last Subject Direct Message Multiple Values Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Client related work enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants