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

Added test on direct get with subject filter #5953

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

aricart
Copy link
Member

@aricart aricart commented Oct 2, 2024

Signed-off-by: Your Name alberto@nats.io

Signed-off-by: Alberto Ricart <alberto@synadia.com>
defer sub.Unsubscribe()
msg, err := sub.NextMsg(10 * time.Millisecond)
require_NoError(t, err)
require_Equal(t, "1", msg.Header.Get(JSSequence))
Copy link
Member Author

@aricart aricart Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derekcollison Expected the first message to be sequence 1 - tried with the request being 0 as well. But first message here is always sequence 2 - b

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the main issue is that currently the filter for the subjects triggers as a last for subject - but need an option that is simply a subject filter without last semantics. Perhaps this could be aligned with consumer semantics where last_per_subject is a boolean, and we just have a filter_subjects that specifies the filter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to use NextFor to walk through messages. The one you are using is only for last by subject.

@github-actions github-actions bot added the stale This issue has had no activity in a while label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue has had no activity in a while
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants