Skip to content

Is it possible to explicitly ask from JetStream to (re)send the last few messages it received in subject foo.*? #2809

Answered by jnmoyne
dsidirop asked this question in Q&A
Discussion options

You must be logged in to vote

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:

  • programmatically defining a 'temporary' durable pull consumer by using a unique random name
  • then using it by subscribing from it and using Fetch() to iterate through the result set until you get X messages (#3 above)
  • call fetch in a loop util you get a message with a time stamp > when you created that pull consumer (#1 a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dsidirop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants