addQueue.leaseTasks(options) 返回空参数 []
当我尝试获取数据时,我创建了一个添加数据的队列 TaskHandle 有一个空的 parms[]
//加入队列 Queue addQueue = queueService.addQueue(); TaskHandle 任务 = addQueue.add(mapFundToTask(fund));
private TaskOptions mapFundToTask(Fund fund){
return TaskOptions.Builder.withMethod(Method.PULL)
.tag("FundTask")
.param("ClientId", fund.getClientId())
.param("FundId", fund.getFundId())
.param("FundName", fund.getFundName());
}
// Get data from queue
Queue addQueue = queueService.addQueue();
int count = 2;
Long leaseDuration = 1000L;
LeaseOptions options = LeaseOptions.Builder
.withTag("FundTask")
.countLimit(count)
.leasePeriod(leaseDuration, TimeUnit.MILLISECONDS);
List<TaskHandle> tasks = addQueue.leaseTasks(options);