use of io.nuls.core.utils.queue.entity.PersistentQueue in project nuls by nuls-io.
the class QueueService method createQueue.
/**
* 创建一个持久化队列
*
* @param queueName 队列名称
* @param maxSize 单个文件最大大小fileLimitLength/非持久化时是队列的最大长度
* @param latelySecond 统计日志打印时间段
* @return 是否创建成功
*/
public boolean createQueue(String queueName, Long maxSize, boolean persist, int latelySecond) {
try {
AbstractNulsQueue queue = null;
if (persist) {
queue = new PersistentQueue(queueName, maxSize);
} else {
queue = new BlockingQueueImpl(queueName, Integer.parseInt(maxSize + ""));
}
QueueManager.initQueue(queueName, queue, latelySecond);
return true;
} catch (Exception e) {
Log.error("", e);
return false;
}
}
Aggregations