Creating Pull Queues

This page describes how to create a pull queue. You must create the queue before you can add tasks to it. The page also describes how to pause or delete a queue.

Defining queues with a queue configuration file

You create pull queues using the queue configuration file, queue.xml or queue.yaml, for your application. The process is the same as creating named push queues, with a specialized directive, <mode>pull</mode>, added to the file.

appcfg/xml

<?xml version="1.0" encoding="UTF-8"?>
<queue-entries>
  <queue>
    <name>my-queue-name</name>
    <mode>pull</mode>
  </queue>
</queue-entries>

gcloud/yaml

 queue:
 - name: my-queue-name
   mode: pull

To upload the file:

appcfg/xml

Mac/Linux:

[PATH_TO_APP_ENGINE_SDK]\bin\appcfg.sh update [YOUR_APP_DIR]

Windows:

[PATH_TO_APP_ENGINE_SDK]\bin\appcfg.cmd update [YOUR_APP_DIR]

gcloud/yaml

gcloud app deploy queue.yaml

Disabling queues

You can disable, or pause, a queue by removing its definition from your queue configuration file and then uploading the updated file.

Once the updated file is uploaded, the queue is set to "disabled" and its rate is set to 0. Any tasks that are in the queue or new tasks that are added to the queue will not be processed. You can re-enable the disabled queue by uploading a new queue file with the queue defined.

You can also pause a queue from within the Task Queues page in the Cloud Console

Deleting queues

To delete a queue you must first disable it:

  1. Remove the queue definition from your queue configuration file.

  2. Upload the changed file.

appcfg/xml

[PATH_TO_APP_ENGINE_SDK]\bin\appcfg.sh update_queues [YOUR_APP_DIR]

or on Windows:

[PATH_TO_APP_ENGINE_SDK]\bin\appcfg.cmd update_queues [YOUR_APP_DIR]

gcloud/yaml

gcloud app deploy queue.yaml

Once the queue is disabled, use the Cloud Console to delete it.

  1. In the Cloud Console, select the queue.

    Go to the Task queues page

  2. Click Delete queue.

If you delete a queue from the Cloud Console, you must wait 7 days before recreating with the same name.

What's next

Bu sayfayı yararlı buldunuz mu? Lütfen görüşünüzü bildirin:

Şunun hakkında geri bildirim gönderin...

App Engine standard environment for Java 8