添加和租賃任務我有以下隊列定義InvalidQueueModeException而在應用服務引擎
<queue>
<name>ranker-queue</name>
<mode>pull</mode>
</queue>
在10倍
Queue q = QueueFactory.getQueue("ranker-queue");
TaskOptions taskOptions = TaskOptions.Builder.withMethod(TaskOptions.Method.PULL);
q.add(taskOptions);
一個循環中的10次
Queue q = QueueFactory.getQueue("ranker-queue");
List<TaskHandle> tasks = q.leaseTasks(3600, TimeUnit.SECONDS, 5);
//Processing
q.deleteTask(tasks);
環路在循環幾次之後的兩種情況下,都會給出以下例外
com.google.appengine.api.taskqueue.InvalidQueueModeException: Target queue mode does not support this operation : null
at com.google.appengine.api.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:139)
at com.google.appengine.api.taskqueue.QueueImpl$2.wrap(QueueImpl.java:552)
at com.google.appengine.api.taskqueue.QueueImpl$2.wrap(QueueImpl.java:521)
at com.google.appengine.api.utils.FutureWrapper.wrapAndCache(FutureWrapper.java:55)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:92)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:88)
at com.google.appengine.api.taskqueue.QueueApiHelper.getInternal(QueueApiHelper.java:72)
at com.google.appengine.api.taskqueue.QueueImpl.add(QueueImpl.java:413)
和
Caused by: com.google.appengine.api.taskqueue.InvalidQueueModeException: Target queue mode does not support this operation :
at com.google.appengine.api.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:139)
at com.google.appengine.api.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java:153)
at com.google.appengine.api.taskqueue.QueueApiHelper$1.convertException(QueueApiHelper.java:52)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:96)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:88)
at com.google.appengine.api.taskqueue.QueueApiHelper.getInternal(QueueApiHelper.java:72)
at com.google.appengine.api.taskqueue.QueueImpl.leaseTasks(QueueImpl.java:810)
爲了讓大家都知道,這個問題自動停止出現。 – SoulMan 2014-11-03 06:07:04