问题
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?
回答1:
Make sure you add a rule to allow inbound traffic for port 5672 in the EC2 Security Group.
来源:https://stackoverflow.com/questions/22134483/cant-connect-from-my-desktop-to-rabbitmq-on-ec2