cant connect from my desktop to rabbitmq on ec2

巧了我就是萌 提交于 2019-12-11 08:29:02

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!