ocuenca
ocuenca

Reputation: 39326

Unable to connect with remote RabbitMQ server

I'm creating a client application with the idea of publish new messages to a remote RabbitMQ queue. I'm using MassTransit to create this client, and my code looks this way:

    static IBusControl CreateBus()
    {
        return Bus.Factory.CreateUsingRabbitMq(x =>
        {             
            var host = x.Host(new Uri(ConfigurationManager.AppSettings["RabbitMQHost"]), h =>
            {
                h.Username("user");
                h.Password("password");
            });

        });
    }

    static IRequestClient<ISyncProject, IProjectSynced> CreateRequestClient(IBusControl busControl)
    {
        var serviceAddress = new Uri(ConfigurationManager.AppSettings["ServiceAddress"]);
        IRequestClient<ISyncProject, IProjectSynced> client =
            busControl.CreateRequestClient<ISyncProject, IProjectSynced>(serviceAddress, TimeSpan.FromDays(1));

        return client;
    }

    private static async Task MainLogic(IBusControl busControl)
    {
        IRequestClient<ISyncProject, IProjectSynced> client = CreateRequestClient(busControl);

       //I'm using the client here as I show below, this part is not important it works with localhost
        IProjectSynced response = await client.Request(new ProjecToSync() { OriginalOOMID = OriginalOOMID });
    }

And the config file looks like this:

<appSettings>
<add key="RabbitMQHost" value="rabbitmq://ServerName" />
<add key="ServiceQueueName" value="queueName" />
<add key="ServiceAddress" value="rabbitmq://ServerName/queueName" />
</appSettings>

I'm not using guest user, I created a new one and I added all the rights as administrator.
enter image description here

Now this code works if I run the client application in the same server where is running RabbitMQ and also changing ServerName by localhost. If I run the client in my local machine using whatever ServerName or IP address of server, RabbitMQ is blocking my connection:

enter image description here

I presume this is has to be with some configuration that I need to do in the server but I have not found it so far.

One thing I noticed now is disk space is in red and and a big amount of generic exchanges have been created enter image description here

Upvotes: 1

Views: 3849

Answers (1)

theMayer
theMayer

Reputation: 16157

As your question shows, down at the bottom you have a connection, but it is blocked.

The RabbitMQ documentation lists some conditions where a connection is blocked. These generally have to do with resource limitations on the broker machine itself. In this case, we've managed to get a clear picture that the free disk space available to the broker is below its low-water mark. Thus, all connections will be blocked until this condition is resolved (either lower the mark - not recommended, or increase the available free space).

Upvotes: 1

Related Questions