I've got a console application that starts up the RabbitMQ server (as an app using the rabbitmq-server.bat file) and then attempts to create a queue on top of it and begin listening for messages. The broker starts up fine but once I try to declare the queue I get an exception stating the queue name doesn't exist. I'm a bit confused at this since I'm trying to create the queue, and don't know why it is looking for an existing one with that name.
Here's the code I'm using to run the server:
var model = QueueModelFactory.CreateModel();
model.ExchangeDeclare(exchangeName, ExchangeType.Fanout, true);
model.QueueDeclare(QueueName, false, false, false, null);
model.QueueBind(QueueName, exchangeName, "");
var subscription = new Subscription(model, QueueName, false);
while (true)
{
var args = subscription.Next();
ProcessQueueItem(args.Body);
subscription.Ack(args);
}
The exception happens on the line the calls QueueDeclare. The exact exception that I get is:
"The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text="NOT_FOUND - no queue 'FavorCompletions' in vhost '/'", classId=50, methodId=10, cause=".
I had this working at one point and then refactored some code only to have it break. I have no clue what I'm doing wrong, since all the sample apps seem to do the exact same thing.
Any help would be appreciated.