I am stuck with the following problem:
I am trying to use .Net 6/C# with RabbitMQ by using RabbitMQ.Client library.
I use docker to get the container of RabbitMQ. The following command is applied:
docker run -d --hostname my-rabbit --name ecomm-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management
Write the following code to create the queue and add a message:
Console.WriteLine("Producer is begining its work..."); var factory = new ConnectionFactory { HostName = "localhost", Port = 5672, UserName = "guest", Password = "guest", VirtualHost = "/" }; using var connection = factory.CreateConnection(); using var channel = connection.CreateModel(); var queueName = "demo-queue"; channel.QueueDeclare(queueName, durable: true, exclusive: false, autoDelete: false, arguments: null); var message = new Message { Name = "Producer", Description = "Hello!" }; var body = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message)); channel.BasicPublish("", queueName, null, body); Console.WriteLine("The message was sent successfully");
Open RabbitMQ management http://localhost:15672/ enter guest credentials. And I cannot find any info about created queue:
Any ideas why I cannot find the queue? I defenitly know that the queue was created and the message was pushed to the queue, because I am able to consume this message. The guest has administration role.