I am trying to use Pull Queue on Google AppEngine, here is the setup
- Users will create a task through my applications REST API
- It then adds a Task to "
TEST_QUEUE
" (mode: PULL)
- It then adds a Task to "
- A Cron job will check the
QueueStatistics
to see if there are any pending tasks, and calculates number of workers to start and pushes the worker config (lease, number of tasks to fetch etc) to a Push Queue - In the Push Queue handler, i am doing some sanity checks and the issuing a
leaseTasks
Java API call- Here is the problem, this call is always returning empty array of TaskHandles.
I am testing this on AppEngine infrastucture and only 1 handler is attempting to leaseTasks
This is how I am adding the task
Queue queue = QueueFactory.getQueue("TEST_QUEUE");
TaskOptions options = TaskOptions.Builder.withMethod(TaskOptions.Method.PULL)
.payload("Test");
This is how i am trying to fetch the tasks
Queue queue = QueueFactory.getQueue("TEST_QUEUE");
Logger.info("Task Count (Before): " + queue.fetchStatistics().getNumTasks());
List<TaskHandle> handles = queue.leaseTasks(300, TimeUnit.SECONDS, 100);
Logger.info("Task Count (After): " + queue.fetchStatistics().getNumTasks());
Logger.info("Handles: " + handles);
I have 3 tasks in the "TEST_QUEUE" (confirmed this from the admin console as well)
Task Count (Before): 3
Task Count (After): 3
Handles: []
After this, the tasks no longer exist when i check in the admin console. I am wondering if someone seen this before or am i doing something wrong? Please advice