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

Getting queue size #75

Closed
asanand opened this issue Oct 29, 2013 · 4 comments
Closed

Getting queue size #75

asanand opened this issue Oct 29, 2013 · 4 comments

Comments

@asanand
Copy link
Contributor

asanand commented Oct 29, 2013

Is there any API available on channel (or it can be supported later) to get the current queue size .. I know that Rabbitmq monitoring API has option to get queue size, but just wondering if there is an API available from channel (Channel.cpp).. My usecase is that I just want to know the workload remaining to be consumed : I know I can go through all messages one-by-one and then determine the queue size. But, is there an alternate simple way?

@alanxz
Copy link
Owner

alanxz commented Oct 29, 2013

Yes: Channel::DeclareQueueWithCounts() does what you want.

@alanxz
Copy link
Owner

alanxz commented Jan 2, 2014

Closing this. If you have any further questions feel free to re-open this issue or open a new one.

@alanxz alanxz closed this as completed Jan 2, 2014
@kreuzerkrieg
Copy link

is there any side effect or performance impact of polling the channel with Channel::DeclareQueueWithCounts?

@alanxz
Copy link
Owner

alanxz commented May 4, 2014

@kreuzerkrieg from a Client's perspective each time you call Channel::DeclareQueueWithCounts that is one round-trip to the broker. I'm not sure how efficiently the queue.declare method is implemented on the broker when called with the passive flag set. I presume you're interested in maintaining a count of the number of messages in a queue. You should ask on the rabbitmq-discuss@ email list about how well the broker might deal with this.

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

3 participants