add 增加 QueueUtils 操作普通队列的方法

feature/model
疯狂的狮子li 2 years ago
parent ccb1449fb2
commit 1920ba94b7

@ -30,6 +30,35 @@ public class QueueUtils {
return CLIENT; return CLIENT;
} }
/**
*
*
* @param queueName
* @param data
*/
public static <T> boolean addQueueObject(String queueName, T data) {
RBlockingQueue<T> queue = CLIENT.getBlockingQueue(queueName);
return queue.offer(data);
}
/**
* null
*
* @param queueName
*/
public static <T> T getQueueObject(String queueName) {
RBlockingQueue<T> queue = CLIENT.getBlockingQueue(queueName);
return queue.poll();
}
/**
*
*/
public static <T> boolean removeQueueObject(String queueName, T data) {
RBlockingQueue<T> queue = CLIENT.getBlockingQueue(queueName);
return queue.remove(data);
}
/** /**
* *
* *

Loading…
Cancel
Save