issue:
java.util.concurrent.TimeoutExceptionat com.rabbitmq.utility.BlockingCell.get(BlockingCell.java:77)at com.rabbitmq.utility.BlockingCell.uninterruptibleGet(BlockingCell.java:111)at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:37)at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:367)at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:293)at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:36)at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:84)at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:613)at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:648)
解决办法:
该测试的broker使用了一台,没有主备,所以在/etc/hosts下没有配置IP和域名的对应关系。因此导致producer调用api登陆broker有时候比较耗时。
参考broker上IP和hostname配置说明:
http://www.rabbitmq.com/clustering.html
http://docs.celeryproject.org/en/latest/getting-started/brokers/rabbitmq.html