title: Connecting app to RabbitMQ cluster through MassTransit. AuthenticationFailureException: ACCESS_REFUSED
body: <p>I have the following situation:</p>
  
  <ul>
  <li>a server named <strong>testServer</strong> where my RabbitMQ cluster is located.</li>
  <li>cluster name:  <strong>rabbit@MyCompany-rabbitmq-test-node01</strong></li>
  <li>in the server there are currently 3 nodes, each one running inside its own docker container. Let's take only one node in example and its container named: <strong>company-rabbitmq-test-node01</strong></li>
  <li>The ports of this container are correctly open (5672 is the port to contact the node, and 15672 is the port of the plugin)</li>
  <li>Virtual host:</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/Qf3BP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qf3BP.png" alt="enter image description here"></a></p>
  
  <p>In my code:</p>
  
  <pre><code>container.AddMassTransit(x =&gt;
  {
      LogContext.ConfigureCurrentLogContext(container.Resolve&lt;SerilogLoggerFactory&gt;());
      x.AddBus(context =&gt; Bus.Factory.CreateUsingRabbitMq(cfg =&gt;
      {
          var host = cfg.Host("testServer", hostConfigurator =&gt;
          {
              hostConfigurator.Username("user-app");
              hostConfigurator.Password("user-password");
  
              hostConfigurator.UseCluster(c =&gt;
              {
                  string[] hostnames = ("testServer:5672;testServer:5682;testServer:5692").Split(';');
                  c.ClusterMembers = hostnames;
              });
          });
  
  
          cfg.ConfigureEndpoints(container);
      }));
  
  });
  
  IBusControl busControl = container.Kernel.Resolve&lt;IBusControl&gt;();
  try
  {
      busControl.Start();
  }
  catch (Exception ex)
  {
      var logger = container.Resolve&lt;ILogger&gt;();
      logger.Error("RabbitMQ broker is not reachable, BusControl cannot be started. ", ex);
  }
  </code></pre>
  
  <p>PROBLEM: when I try to start the application it says:</p>
  
  <blockquote>
    <p>Broker unreachable: testServer:5672/  ---> RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> RabbitMQ.Client.Exceptions.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.</p>
  </blockquote>
  
  <p>My user page:</p>
  
  <p><a href="https://i.stack.imgur.com/5Jw68.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5Jw68.png" alt="enter image description here"></a></p>
  
  <p>the <strong>user-app</strong> has access to the virtual host. Am I missing something?</p>