NATS Get message by id

448 views
Skip to first unread message

Dana Keydar

unread,
Aug 2, 2022, 4:52:59 AM8/2/22
to nats
Hi all,
Is there any way to get an existing message by id ? 

Tnx.

derek

unread,
Aug 2, 2022, 8:47:12 AM8/2/22
to nats
Not at this time, only by sequence number, or last for subject, or next for subject with a given starting sequence number.

Dana Keydar

unread,
Aug 3, 2022, 1:43:27 AM8/3/22
to nats
Hi Derek,
Thanks foe the quick response!

I realized each message has unique sequence number right? and when publishing a message  I can keep this sequence number and later get this specific message using the sequence number?
If so , how can I do it? I didn't find any examples of it.

derek

unread,
Aug 3, 2022, 10:50:21 AM8/3/22
to nats
Yes that is correct.

For admin purposes most clients allow you to get the message directly from the stream.


In the next release their is a more highly optimized version to support the KV materialized views.

Reply all
Reply to author
Forward
0 new messages