Commit 7e5db4a0 authored by yanzg's avatar yanzg

修复等待时间

parent 81dff773
...@@ -12,7 +12,6 @@ import org.springframework.stereotype.Component; ...@@ -12,7 +12,6 @@ import org.springframework.stereotype.Component;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Properties;
/** /**
* 基本队列处理类 * 基本队列处理类
...@@ -103,18 +102,9 @@ public class BeanDao { ...@@ -103,18 +102,9 @@ public class BeanDao {
} }
// 创建实体 // 创建实体
Queue queueNew = new Queue(queueName, true, false, false, params); Queue queueNew = new Queue(queueName, true, false, false, params);
boolean isCreateQueue = true; YzgTimeout.timeOut(BeanDao.class, "创建队列" + queueName, () -> {
try { amqpAdmin.declareQueue(queueNew);
Properties queueProperties = amqpAdmin.getQueueProperties(queueName); });
isCreateQueue = !queueProperties.isEmpty();
} catch (Exception ex) {
if (ex != null) {
ex.printStackTrace();
}
}
if (isCreateQueue) {
YzgTimeout.timeOut(BeanDao.class, "创建队列" + queueName, () -> amqpAdmin.declareQueue(queueNew));
}
// 将实体注册到上下文中 // 将实体注册到上下文中
register(key, queueNew); register(key, queueNew);
// 重新获取实体 // 重新获取实体
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment