c#


Can I iterate through queues using the RabbitMQ .NET Client?


I'd like a way to iterate through existing queues on a rabbit server's virtual host, and output the number of messages in the queues, without hardcoding the queue names into my C# code.
Here's an example of getting the number of messages in a queue by hardcoding the queue value, using the RabbitMQ .NET Client:
using System;
using RabbitMQ.Client;
namespace RabbitMonitor
{
class Program
{
static void Main(string[] args)
{
var factory = new ConnectionFactory()
{
HostName = "<HostName>",
UserName = "<UserName>",
Password = "<Password>",
VirtualHost = "<VirtualHost>",
Port = 5672
};
var queueNameMessageCount = 0;
using (var connection = factory.CreateConnection())
using (var channel = connection.CreateModel())
{
queueNameMessageCount = channel.MessageCount("<QueueName>");
}
}
}
}
Is there a way I can get a collection of queues / queue names that are on a given virtual host, using the RabbitMQ .NET Client?
Related: is there a way for be to get a collection of virtual hosts/virtual host names on a server, using the RabbitMQ .NET Client?

Related Links

MVC4 validation for select option value
WPF UserControl doesn't capture events after being reloaded
“SCRIPT5 Access is denied” error on IE9 when firing .click() from onchange
string partial comparison [duplicate]
Accessing private fields in the base and child classes using reflection
Why the Embedded Image sent through the LinkedResource is also attached as an Attachement
How to detect the next free column in a excel workbook with c#
Fluent interfaces (method chaining) with backwards navigation
Using show.hide on a drop down list in c#?
C# Determine If Object Is Present In An Image
Pass commands to .NET GUI from external editor
how to pass value to method from html using ASP.Net?
Is sql injection possible in stored procedures with text param?
How can I avoid double casting?
where condition in MySQL Insert statement
How can I join an array of strings but first remove the elements of the array that are empty?

Categories

HOME
skype-for-business
algolia
wifi
webvr
reference
datetimepicker
overrides
sms
xss
mailchimp
sdk
ms-access-2010
servicenow
restheart
angularjs-ng-repeat
adroitlogic
opengrok
github-flavored-markdown
bookmarklet
greensock
ringcentral
alert
draw2d
pushbullet
infinite-loop
advertising
core-animation
proof-general
resx
checkmarx
ipython-parallel
spring-data-gemfire
schedule
urhosharp
language-detection
ng2-bootstrap
luhn
apache-falcon
wunderground
asp.net-webhooks
aweber
azure-storage-files
linkurious
file-descriptor
rexx
hdpi
emacs24
ear
jcifs
totalview
jtextarea
tsc
zsh-completion
glade
consolidation
xcode7.1
rowname
init
camellia
calc
ewam
cascading
mojolicious
redquerybuilder
android-togglebutton
musicbrainz
android-networking
grails-3.0.9
veeam
sony-xperia
indices
frisby.js
mind-manager
parsefloat
powershell-v1.0
triplestore
class-library
mdp
complete
google-voice
maven-webstart-plugin
uikit-dynamics
moonscript
yii-components
doxia
derived-class
android-memory
aspmenu-control
mvcmailer
commonsware
n2
hs-err
excellibrary
google-local-search
jquery-attributes
focus-stealing
weak-typing
ironpython-studio

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App