digerati
digerati

Reputation: 85

Pull Queue leaseTasks is not returning any TaskHandles

I am trying to use Pull Queue on Google AppEngine, here is the setup

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

Upvotes: 1

Views: 194

Answers (1)

digerati
digerati

Reputation: 85

Ok... after a few trial and error attempts, i found the issue

The following was my queue.xml snippet for the queue mentioned above.

<queue>
    <name>TEST_QUEUE</name>
    <mode>pull</mode>
    <retry-parameters>
        <task-retry-limit>0</task-retry-limit>
    </retry-parameters>
</queue>

The problem was fixed after <retry-parameters> was removed from the above snippet. I was trying to convert this queue from a Push queue, so i neglected to remove this since Java Task Queue Configuration doesn't mention that this parameter is only for Push Queue

Hope this helps someone :)

Upvotes: 0

Related Questions