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

Setting a property hidden by control's interface
EF Code First 4.1: “Multiple Inheritence” (Is A) Question
TripleDESCryptoServiceProvider using hex key
Use SQL Server CE Locally and SQL Server 2008 on Production Entity Framework Code First?
CRM 2011 SecurityNegotiationException trying to access web services
How to place child controls in a certain order when binding a custom control?
How to get rid of the exception “The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine” in Win 7
How to position a form on top of another form without taking the focus
filter IQueryable in a loop with multiple Where statements
How to write value to html field from asp.net code behind
facebook graph api: /me OAuthException (c#)
Changing input value using javascript
C# HttpWebRequest SEC_I_RENEGOTIATE Intermittent Errors
Entity Framework Timeouts
SqlException Transaction was deadlocked on communication buffer resources
Delete multiple rows from Grid

Categories

HOME
asp.net
ssms
msbuild
url
netty
alasql
casting
webvr
android-ndk
crm
x509certificate
arguments
lithium
artifactory
browser-cache
psexec
schema
open-search-server
runtime
ndepend
facebook-sharer
distinct
drush
fastreport
swift3.1
aggregate
web-worker
tag-cloud
dompdf
react-jsx
gnu-screen
javaagents
screen-scraping
gsuite
ppp
nsopenpanel
expressionengine
marionette
windows-10-mobile
emr
jbossfuse
xlib
blockly
snapkit
ilog
incapsula
odp.net
stencyl
mockserver
ng-lightning
ninja-forms
vertical-alignment
compiler-warnings
bzip2
stanford-nlp-server
htop
sharpssh
ajv
selection-sort
opticalflow
jtextarea
multi-select
disassembly
google-scholar
directinput
angular-i18n
bbedit
cexception
factorization
abstract
trendline
encode
android-facebook
ruby-1.8.7
sdkman
notice
page-flipping
dnvm
roslyn-code-analysis
avrcp
pagecontrol
playn
transparentproxy
cakephp-2.6
drools-guvnor
frisby.js
report-builder2.0
clearcanvas
disparity-mapping
debuggervisualizer
smartxls
grunt-wiredep
jfilechooser
surfaceview
infomaker
usersettings
bho
cloudmade
openafs
certificate-revocation
nude.js
visual-leak-detector
sipdroid
sessiontracking
lgpl

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