Queues in RabbitMQ Management are not displayed

112 Views Asked by At

I am stuck with the following problem:

I am trying to use .Net 6/C# with RabbitMQ by using RabbitMQ.Client library.

  1. 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
    
  2. 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");
    
  3. Open RabbitMQ management http://localhost:15672/ enter guest credentials. And I cannot find any info about created queue: enter image description here

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.

0

There are 0 best solutions below