1

My friend has a problem with connection to rabbitmq via docker toolbox.

The whole team uses windows pro or edu, where we don't have any problems with docker. But one of my friend has windows home, so we needed to download docker toolbox. When we open rabbitmq management, it works well, but when we try to connect to rabbit, we get error message: "refuse to connect".

 public void startRabbitMQ() {
        ConnectionFactory factory = new ConnectionFactory();
        setSpecificationFactory(factory);

        try {
            connection = factory.newConnection();
        } catch (IOException | TimeoutException e) {
            e.printStackTrace();
        }


        try {
            channel = Objects.requireNonNull(connection).createChannel();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private void setSpecificationFactory(ConnectionFactory factory){
        factory.setUsername("guest");
        factory.setPassword("guest");
        factory.setVirtualHost("/");
        factory.setHost("localhost");
        factory.setPort(5672);
    }

We all use this code to connect, and, as I said, it works well. We think that it is a problem with the line:"factory.setHost([...])" We all need only connect with localhost, but when we connect via docker toolbox we try many different options like: localhost, 192.168.99.101, 127.0.0.1

With docker toolbox we need to use different IP, which is shared for us from kitematic, like on SS below, so we tried 192.168.99.101, but still it didn't work.

As I said, rabbitmq management works properly. We just used chrome and open "192.168.99.101:15672".

We tried

  1. shut down antivirus and firewall
  2. check, if port is used
  3. virtualization is enabled

Docker toolbox kitematic

Community
  • 1
  • 1

0 Answers0