question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remote RabbitMQ Connection Timeout using .NET Core 2.0

See original GitHub issue

I am not sure if this is due to Core 2.0 but I can run it fine on non core.

The code I am using is below.

Options

  "RabbitMQ": {
    "Host": "rabbitmq://192.168.160.131/",
    "Username": "test",
    "Password": "1"
  },

Bus

            var busControl = Bus.Factory.CreateUsingRabbitMq(cfg =>
            {
                var host = cfg.Host(new Uri(_rabbitMQOptions.Host), h =>
                {
                    h.Username(_rabbitMQOptions.Username);
                    h.Password(_rabbitMQOptions.Password);
                });


                cfg.ReceiveEndpoint(host, nameof(TestCommand), e =>
                {
                    e.Consumer(() =>
                    {
                        return new TestConsumer();
                    });

                    e.PrefetchCount = 2;
                });

            });


            _logger.LogInformation("Starting bus");
            busControl.Start();
            _logger.LogInformation("Bus started");
            _logger.LogInformation("Waiting for messages");

Command & Consumer


    public class TestCommand
    {
    }

    public class TestConsumer : IConsumer<TestCommand>
    {

        public TestConsumer()
        {
        }

        public async Task Consume(ConsumeContext<TestCommand> context)
        {
            Console.WriteLine("Consumed");
        }
    }

When I run the code, it fails with

'Connect failed: test@192.168.160.131:5672/'
TimeoutException: The operation has timed out.

This issue occurs with both 3.5.7 and 4.0.0.1216-develop. I have confirmed that I can connect fine by following the rabbitmq hello world tutorial.

Each connection creates the following log entries in rabbitmq.

=INFO REPORT==== 25-Jul-2017::05:00:19 ===
accepting AMQP connection <0.31858.0> (192.168.160.1:51098 -> 192.168.160.131:5672)

=ERROR REPORT==== 25-Jul-2017::05:00:19 ===
closing AMQP connection <0.31858.0> (192.168.160.1:51098 -> 192.168.160.131:5672):
{handshake_timeout,handshake}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:37 (17 by maintainers)

github_iconTop GitHub Comments

3reactions
gertjvrcommented, Aug 8, 2017

@phatboyg I have been using the pre-release package on netcore1.1 and netcore2 without any issue. think we can close this issue.

1reaction
phatboygcommented, Dec 22, 2017

I’m going to close this, enough have it working with core that this isn’t an MT issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RabbitMQ Connection Error " None of the specified ...
I created a small application using .netcore and rabbitmq and created the image in docker for both of them using below docker-compose code...
Read more >
Overview
To open a connection with the .NET client, first instantiate a ConnectionFactory and configure it to use desired hostname, virtual host, credentials, TLS ......
Read more >
Troubleshooting Network Connectivity
Troubleshooting Network Connectivity. Overview. This guide accompanies the one on networking and focuses on troubleshooting of network connections.
Read more >
Management Plugin
Management Plugin. Overview. The RabbitMQ management plugin provides an HTTP-based API for management and monitoring of RabbitMQ nodes and clusters, ...
Read more >
Java Client API Guide
The core API classes are Connection and Channel, representing an AMQP 0-9-1 ... client library failure, a remote network request or network failure....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found