This page describes how to create Cloud Tasks queues using the gcloud
command of the Google Cloud SDK.
Before you begin
To access the Cloud Tasks service using Cloud Tasks API , you must have a
project that contains
an App Engine app located
in a specific region. This location will serve
as the LOCATION_ID parameter for your Cloud Tasks requests, so make a note
of it. Note that two locations, called europe-west
and
us-central
in App Engine commands, are called, respectively,
europe-west1
and us-central1
in Cloud Tasks commands.
The app serves as the location for whatever queues the developer creates.
The underlying Cloud Tasks service itself runs in that same location.
Creating a Cloud Tasks queue
Use the Google Cloud SDK to create your queue:
gcloud tasks queues create [QUEUE_ID]
where:
QUEUE_ID
is the identifier you assign to your queue, for example,my-queue
.
It can take a few minutes for a newly created queue to be available. Then use describe
to verify that your queue was created successfully:
gcloud tasks queues describe [QUEUE_ID]
The output should be something like:
name: projects/[PROJECT_ID]/locations/[LOCATION_ID]/queues/[QUEUE_ID]
rateLimits:
maxBurstSize: 100
maxConcurrentDispatches: 1000
maxDispatchesPerSecond: 500.0
retryConfig:
maxAttempts: 100
maxBackoff: 3600s
maxDoublings: 16
minBackoff: 0.100s
state: RUNNING
If you do not see the above output, you can try the following:
- Wait at least one minute for the queue to initialize.
Make sure a queue with the same ID does not already exist. You can view all queues in your project by calling:
gcloud tasks queues list
Check if you've reached your queue limit:
Go to the Cloud Tasks API page
and select Quotas.
To increase your resource limits, select Edit Quotas from the Quotas page of the Cloud Console
Check each part of the command and re-run it.
What's next
- Learn about configuring Cloud Tasks queues.
- Learn more about queue management in the RPC API reference.
- Learn more about queue management in the REST API reference.
- See the full list of Cloud Tasks
gcloud
commands.