1

I am trying to create an ubuntu vm with rabbitmq on EC2.
I can telnet my rabbit but cant connect with java client.

Here is my code

ConnectionFactory factory = new ConnectionFactory();
factory.setHost("172.31.4.61");
factory.setPort(5672);
Connection connection = factory.newConnection();

I get the following

 java.net.ConnectException: Connection timed out: connect

Any ideas?

Bick
  • 17,833
  • 52
  • 146
  • 251

1 Answers1

4

Make sure you add a rule to allow inbound traffic for port 5672 in the EC2 Security Group.

David Levesque
  • 22,181
  • 8
  • 67
  • 82