-
To get all the messages that JetStream holds within the last 1.5second we can do something like this:
Questions:
Thank you for everything and keep up the good work guys - NATS is awesome! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
One thing would do what you want: an ephemeral pull consumer (and a tiny bit of code in your application to do the check of the timestamp) to know when to stop using that consumer...
Should be all pretty easy to implement |
Beta Was this translation helpful? Give feedback.
One thing would do what you want: an ephemeral pull consumer (and a tiny bit of code in your application to do the check of the timestamp) to know when to stop using that consumer...
... the client API doesn't offer the ability to create an ephemeral pull consumer (yet) but that you could emulate the functionality yourself by doing the following in your application code:
Fetch()
to iterate through the result set until you get X messages (#3 above)