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

Add more options to create a jetstream.GetMsgOpt #1757

Open
zerolfx opened this issue Dec 19, 2024 · 0 comments
Open

Add more options to create a jetstream.GetMsgOpt #1757

zerolfx opened this issue Dec 19, 2024 · 0 comments
Labels
proposal Enhancement idea or proposal

Comments

@zerolfx
Copy link

zerolfx commented Dec 19, 2024

Proposed change

The proposal is to have a similar version with the following code but set req.LastFor = subject.

// WithGetMsgSubject sets the stream subject from which the message should be
// retrieved. Server will return a first message with a seq >= to the input seq
// that has the specified subject.
func WithGetMsgSubject(subject string) GetMsgOpt {
return func(req *apiMsgGetRequest) error {
req.NextFor = subject
return nil
}
}

Use case

I want to get the last message with a specific subject whose seq is <= a given one.

Contribution

No response

@zerolfx zerolfx added the proposal Enhancement idea or proposal label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Enhancement idea or proposal
Projects
None yet
Development

No branches or pull requests

1 participant