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

How to get queue size? #153

Closed
ray-krow-verys opened this issue Mar 9, 2018 · 2 comments
Closed

How to get queue size? #153

ray-krow-verys opened this issue Mar 9, 2018 · 2 comments

Comments

@ray-krow-verys
Copy link

My understanding is that the java-nats library queues up messages that the server sends and dispatches them to the provided callback consumers as fast as it can. But, there is still a queue that messages can store up in.

How can I get the size of this queue? I need to know how far behind my client is for scaling needs.

Something like:
int queueSize = nc.getPendingQueueSize();

@kozlovic
Copy link
Member

kozlovic commented Mar 9, 2018

This is available from the subscription object itself. For instance sub.getPendingMsgs(). There is also pending bytes, the max that were pending, etc..

@kozlovic kozlovic closed this as completed Mar 9, 2018
@ray-krow-verys
Copy link
Author

Confirmed this works, thanks for getting back and closing this so quickly @kozlovic

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

2 participants