我正在尝试测试将我的android代码连接到本地rabbitmq服务器。但是,我总是遇到异常:java.util.concurrent.TimeoutException。 我怎么解决这个问题? 这是我的代码:
ConnectionFactory factory = new ConnectionFactory();
factory.setUri("amqp://phanna:phanna@172.16.150.85:15672/");
factory.setConnectionTimeout(6000000);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
Connection conn = factory.newConnection();
Channel channel = conn.createChannel();