-
Notifications
You must be signed in to change notification settings - Fork 699
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
How to retrieve the status of a consumer. #1620
Comments
You can call To check what subjects (topics) are in stream, you need to check stream subjects. Keep in mind tht Consumer is just a "view" into the stream. Consumers do not store the messages. What you mean by topic being unavailable, or not acting properly? |
I had six topics previously. Due to unknown reasons, a reconnection was triggered, and I'm unsure why the disconnection occurred in the first place. After reconnecting, all topics were supposed to be subscribed to again, but only five were subscribed to. One particular topic consistently failed to consume properly. This occurrence is sporadic, but unfortunately, we are unable to perceive the subscription status of this topic. |
Using consumer's info() did not provide the method to check the subscription topic status that I want. |
When consumer is consuming messages, it does not subscribe separately to subjects. Maybe the messages were about to be redelivered due to reconnect? |
Because the names of the topics are all different, and no * or > is used, there are 6 similar subscriptions in a loop. Therefore, in case of disconnection, I will reconnect. I use the CreateOrUpdateConsumer method. The reason for considering it ineffective is that subscriptions can be received normally on other nodes, but cannot be received properly on this reconnected node. Based on your description, I checked the info method and did not find a method to obtain the status of the topic. |
You do not have to do anything if client disconnects. It will automatically reconnect on it's own and resume all subscriptions and consumers. What you mean that you do reconnect? Maybe this is source of a problem. Regarding the subscriptions: ConsumerConfig {
Durable: "Consumer",
FilterSubjects: []string{"foo.>", "bar.>", "baz.*"},
} its still one subscription because of how JetStream consumer API works and why you will get messages in order. Can you please share your Consumer and Stream configs, so we can better understand your config the issue you're facing? |
Observed behavior
During usage, we discovered that certain topics within the consumer were not functioning properly. Although we attempted to reconnect, we were uncertain when a topic became unavailable.
Expected behavior
We hope for an interface or method that can monitor the consumer's status, ideally providing information on the status of each individual topic.
Server and client version
nats-server :2.10.14
nats.go :1.34.1
Host environment
No response
Steps to reproduce
No response
The text was updated successfully, but these errors were encountered: