nats-io / stan.net

The official NATS .NET C# Streaming Client
Apache License 2.0
137 stars 41 forks source link

Consumer does not process message after changing clientId #171

Closed minhhungit closed 4 years ago

minhhungit commented 4 years ago

As title, consumer will not process message anymore after changing clientId although we are using -all mode


I added video for reproducing

issue-with-client-id.zip

ColinSullivan1 commented 4 years ago

I was able to reproduce this and will take a look.

ColinSullivan1 commented 4 years ago

@minhhungit , This was an issue of the sample application not cleanup up between test runs. The connection and subscription was left "active" between test runs so the streaming server was not redelivering the messages. I have a PR updating the sample code to cleanup on early exit.

You'll want to add a Console.CancelKeyPress event handler in your test application that closes the connection, and if applicable, unsubscribes the durable. An example can be found here.

minhhungit commented 4 years ago

@ColinSullivan1 thank you for looking this issue

Currently I see it works well with this command:

.\StanSub -qgroup newgroup -clientid xyz -all

But when I remove -all/-seq then it won't process message It also does not process message when I add durable param like this

.\StanSub -qgroup groupA -clientid xyz -all -durable aaaa

In another hand, when I used param -last it just show the last message in streams, I thought it will process message from the last message that it processed before at the point consumer is stopped

minhhungit commented 4 years ago

Honestly I am not sure how durable work and how it interacts with other command like -all, -seq, -last

I also upload video for issue demo

issues-with-nats-client.zip