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

StartWithLastReceived : Clarification #192

Open
rampratapa opened this issue Oct 2, 2020 · 0 comments
Open

StartWithLastReceived : Clarification #192

rampratapa opened this issue Oct 2, 2020 · 0 comments

Comments

@rampratapa
Copy link

rampratapa commented Oct 2, 2020

// Subscribe starting with most recently published value
var opts = StanSubscriptionOptions.GetDefaultOptions();
opts.StartWithLastReceived();
var s = c.Subscribe("foo", opts, (obj, args) =>
{
    Console.WriteLine("Received a message: {0}",
        System.Text.Encoding.UTF8.GetString(args.Message.Data));
});

I have question about the above StartWithLastReceived flag. What is really it is doing

  • Case 1 : The messages are published and subscribers are down. For example publisher publishes 1 to 10 messages. the subscriber is up at message 9, if the above property is set then it start receiving from 9 and 10 and ignore previous ones or it receives messages from 1 through 10.

  • Case 2: if the publisher publishes 1 to 20, the subscribers down randomly and it is a durable subscribers case and if we set the above property, do we receive all messages or did we loose messages.

Another question, what is the default behavior.

Thank you for your help.

Thanks
ram

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant