Von Aufgabenwarteschlangen zu Cloud Tasks migrieren
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Sie können eine Migration über die App Engine Task Queue API vom Warteschlangendienst "Aufgabenwarteschlangen" der App Engine-Standardumgebung durchführen, um über die neue RPC/REST API "Cloud Tasks" auf denselben Dienst zuzugreifen. Cloud Tasks kann außerhalb der App Engine-Standardlaufzeiten der ersten Generation eingesetzt werden, insbesondere über alle flexiblen App Engine-Umgebungen und über alle App Engine-Standardlaufzeiten der zweiten Generation.
Cloud Tasks und der aktuelle Aufgabenwarteschlangendienst für die App Engine-Standardumgebung existieren nebeneinander in derselben Umgebung. Über beide APIs können Sie Elemente zu Warteschlangen hinzufügen. Unabhängig davon, ob Sie das App Engine SDK oder die neue Cloud Tasks API verwenden, leitet eine Warteschlange innerhalb der Anwendung Aufgaben an eine Handler-URL zur asynchronen Verarbeitung weiter.
Neue Funktionen
Cloud Tasks bietet einige Funktionen, die über das App Engine SDK nicht verfügbar sind, darunter die folgenden:
Warteschlangenverwaltung über die API:
Über die API, die Console oder den Befehl gcloud können Sie weitere Aufgaben zur Warteschlangenverwaltung erstellen, löschen, anhalten und ausführen.
Befehl zum Auflisten von Warteschlangen:
Sie können alle Warteschlangen auflisten, die Sie in Ihrem Projekt eingerichtet haben.
Befehl zum Auflisten von Aufgaben:
Sie können alle Aufgaben in einer Ihrer Warteschlangen auflisten.
Einbinden der Identitäts- und Zugriffsverwaltung (Identity and Access Management, IAM):
Mit IAM können Sie den Zugriff auf Ihre Warteschlangen und Aufgaben sehr differenziert sichern.
HTTP-Ziele
Sie können Handler auf jeden HTTP-Endpunkt mit einer öffentlichen IP-Adresse ausrichten.
Funktionen für Aufgabenwarteschlangen, die noch nicht über die Cloud Tasks API verfügbar sind:
Das Einreihen einer Aufgabe in eine Warteschlange wird von Cloud Tasks nicht als Teil einer Cloud Datastore-Transaktion unterstützt, sodass die Aufgabe nur dann (aber dann garantiert) in eine Warteschlange aufgenommen wird, wenn für die Transaktion ein erfolgreicher Commit durchgeführt wurde.
Für bestimmte Fälle, in denen eine Reihe unterschiedlicher kleiner Aufgaben asynchron behandelt werden soll, Sie aber keine einzelnen unterschiedlichen Handler einrichten möchten, bietet das App Engine SDK laufzeitspezifische Bibliotheken zum Erstellen einfacher Funktionen, mit denen diese Aufgaben verwaltet werden können. Diese Funktion ist in Cloud Tasks nicht verfügbar. Beachten Sie aber, dass ein Verlegen von normalen Aufgaben in die Zukunft mit Cloud Tasks möglich ist.
Einige der Laufzeiten, die das App Engine SDK verwenden, haben APIs, die eine Mehrinstanzenfähigkeit für Aufgaben durch das Vergeben von Namespaces unterstützen. Diese Funktion ist in Cloud Tasks nicht verfügbar.
Der von der gcloud CLI oder dem App Engine SDK bereitgestellte lokale Entwicklungsserver unterstützt keine simulierten Endpunkte für Cloud Task API-Aufrufe.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[],[],null,["# Migrate from Task Queues to Cloud Tasks\n\nYou can migrate from using App Engine standard environment's queue service\n(Task Queues) via the App Engine Task Queue API to accessing that same service\nusing Cloud Tasks, a new RPC/REST API. Cloud Tasks can be\nemployed outside of first generation App Engine runtimes, particularly from all\n[App Engine flexible environments](/appengine/docs/flexible), as well as from\n[second generation App Engine standard environment\nruntimes](/appengine/docs/standard/runtimes).\n\nCloud Tasks and the current App Engine standard environment\ntask queue service exist in a single universe. You can add to the same\nqueues through either API. Regardless of whether you use the App Engine SDK\nor the new Cloud Tasks API , a queue within the app forwards a task to a\nhandler URL for asynchronous processing.\n\n### New features\n\nCloud Tasks provides some features not available via the App Engine\nSDK, including the following:\n\n- Queue management via the API:\n\n You can create, delete, pause, and perform other queue management tasks\n using the API, through the Console, or via the `gcloud` command.\n- List Queues command:\n\n You can list all the queues you have set up in your project.\n- List Tasks command:\n\n You can list all the tasks in any of your queues.\n- Identity and Access Management (IAM) integration:\n\n You can secure access to your queues and tasks in a highly granular way\n using [IAM](/iam).\n- HTTP Targets\n\n You can target handlers at any HTTP endpoint with a public IP address.\n\n### Features in Task Queues not yet available via Cloud Tasks API :\n\n- [Pull queues](/appengine/docs/standard/python/taskqueue/pull):\n\n You can use [Cloud Pub/Sub](/pubsub), a GA product, to implement many of\n the same use cases as pull queues.\n- [Transactional tasks](/appengine/docs/standard/python/taskqueue/push/creating-tasks#enqueuing_tasks_in_cloud_datastore_transactions):\n\n Cloud Tasks does not support enqueuing a task as part of a\n Cloud Datastore transaction, such that the task is only enqueued - and is\n guaranteed to be enqueued - if the transaction is committed successfully.\n- [Deferred/delayed tasks](/appengine/docs/standard/python/taskqueue/push/creating-tasks#using_the_instead_of_a_worker_service):\n\n In some cases where you might need a series of diverse small tasks handled\n asynchronously but you don't want to go through the work of setting up\n individual distinct handlers, the App Engine SDK allows you to use runtime\n specific libraries to create simple functions to manage these tasks. This\n feature is not available in Cloud Tasks. Note, though, that\n normal tasks *can* be scheduled in the future using Cloud Tasks.\n- [Namespacing](/appengine/docs/standard/python/taskqueue/push/creating-tasks#working_with_tasks_in_a_multi-tenant_application):\n\n Some of the runtimes that use the App Engine SDK have APIs that\n support task multitenancy through namespacing. This feature is not\n available in Cloud Tasks.\n- [Local emulator](/appengine/docs/standard/python/tools/using-local-server):\n\n The local development server provided by the gcloud CLI or the App Engine SDK\n does not support simulated endpoints for Cloud Tasks API calls.\n- [Asynchronous task add](/appengine/docs/standard/python/taskqueue/push/creating-tasks#adding_tasks_asynchronously):\n\n Users of the App Engine SDK can choose to add tasks to queues asynchronously.\n This feature is not available in Cloud Tasks.\n\n### For more information\n\nMore detailed guides for migrating your code can be found in the App Engine Task Queue\ndocumentation set:\n\n- Migrating from Python 2.7 [pull queues](/appengine/docs/standard/python/taskqueue/pull/migrating-pull-queues) to Pub/Sub\n- Migrating from Python 2.7 [push queues](/appengine/docs/standard/python/taskqueue/push/migrating-push-queues) to Cloud Tasks\n- Migrating from Java 8 [pull queues](/appengine/docs/standard/java/taskqueue/pull/migrating-pull-queues) to Pub/Sub\n- Migrating from Java 8 [push queues](/appengine/docs/standard/java/taskqueue/push/migrating-push-queues) to Cloud Tasks"]]