Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Diese Seite bietet eine Übersicht über Push-Warteschlangen. Push-Warteschlangen führen Aufgaben durch Weiterleitung von HTTP-Anfragen an App Engine-Worker-Dienste aus. Die Anfragen werden mit einer konstanten Rate bereitgestellt. Wenn eine Aufgabe fehlschlägt, wiederholt der Aufgabenwarteschlangendienst die Aufgabe. Dazu wird eine weitere Anfrage vom Dienst gesendet. Sie müssen einen Handler zur Verarbeitung jede Art von verwendeter Aufgabe angeben. Ein einzelner Dienst kann mehrere Handler für verschiedene Typen von Aufgaben haben. Sie können auch unterschiedliche Dienste zur Verwaltung unterschiedlicher Aufgabentypen verwenden.
Aufgabenfrist
Wenn ein Worker-Dienst eine Anfrage für eine Push-Aufgabe empfängt, muss er die Anfrage verarbeiten und vor Ablauf einer Frist, die sich nach dem Skalierungstyp des Worker-Dienstes richtet, eine HTTP-Antwort senden.
Automatische Skalierungsdienste müssen innerhalb von 10 Minuten abgeschlossen sein.
Manuelle und einfache Skalierungsdienste können bis zu 24 Stunden ausgeführt werden.
Ein HTTP-Antwortcode zwischen 200 und 299 zeigt an, dass die Ausführung erfolgreich war. Bei allen anderen Werten ist die Aufgabe fehlgeschlagen. Wenn die Aufgabe innerhalb der Frist keine Reaktion auslöst oder einen ungültigen Antwortwert zurückgibt, wird die Aufgabe wiederholt.
Fehlgeschlagene Aufgaben wiederholen
Wenn der Anfrage-Handler für eine Push-Aufgabe einen HTTP-Statuscode außerhalb des Bereichs von 200 bis 299 oder vor Ablauf der Aufgabenfrist keine Antwort zurückgibt, wird in der Warteschlange die Aufgabe wiederholt, bis sie erfolgreich ausgeführt wurde. Nach und nach wird der Sendevorgang reduziert, um zu verhindern, dass zu viele Anfragen an die Anwendung gesendet werden. Fehlgeschlagene Aufgaben werden jedoch mindestens einmal pro Stunde wiederholt.
Mit Push-Warteschlangen arbeiten
Für die Arbeit mit Push-Warteschlangen müssen folgende Mindestvoraussetzungen erfüllt sein:
Erstellen Sie Aufgaben programmatisch und fügen Sie diese der Standard-Push-Warteschlange bzw. einer oder mehreren benannten Push-Warteschlangen hinzu, die Sie erstellt haben.
Schreiben Sie einen Handler, der die Anfrage einer Aufgabe verarbeitet, und weisen Sie den Handler einem App Engine-Dienst zu.
[[["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-04-21 (UTC)."],[[["\u003cp\u003ePush queues dispatch HTTP requests to App Engine worker services, delivering them at a constant rate, and will retry tasks if they fail.\u003c/p\u003e\n"],["\u003cp\u003eWorker services handling push task requests must respond before a deadline, which is 10 minutes for automatic scaling services and up to 24 hours for manual and basic scaling services.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful task completion is indicated by an HTTP response code between 200-299, while other codes or failures to respond result in task retries.\u003c/p\u003e\n"],["\u003cp\u003eWorking with push queues involves programmatically creating tasks and adding them to queues, as well as writing handlers to process task requests within App Engine services.\u003c/p\u003e\n"],["\u003cp\u003eYou have the option to create multiple queues for efficient task handling, and monitor these queues in the Google Cloud console, along with additional quotas.\u003c/p\u003e\n"]]],[],null,["# Use Push Queues\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\nGo Java PHP Python\n\nThis page provides an overview of push queues. Push queues run tasks by\ndispatching HTTP requests to App Engine worker services. The requests are\ndelivered at a constant rate. If a task fails, the service retries the task,\nsending another request. You must provide a handler for every kind of task you\nuse. A single service can have multiple handlers for different kinds of tasks, or\nyou can use different services to manage different task types.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n|\n| /services/access). If you are updating to the App Engine runtime, refer to the [Upgrade to second-generation runtimes]() page to learn about your migration options for legacy bundled services.\n\nThe task deadline\n-----------------\n\nWhen a worker service receives a push task request, it must handle the request\nand send an HTTP response before a deadline that depends on the [scaling\ntype](/appengine/docs/an-overview-of-app-engine#instances)\nof the worker service.\n\nAutomatic scaling services must finish before 10 minutes have elapsed.\nManual and basic scaling services can run up to 24 hours.\n\nAn HTTP response code between 200--299 indicates success; all other values\nindicate the task failed. If the task fails to respond within the deadline, or\nreturns an invalid response value, the task is retried.\n\nRetrying a failed task\n----------------------\n\nIf a push task request handler returns an HTTP status code outside the range\n200--299, or fails to return any response before the task deadline occurs, the queue\nretries the task until it succeeds. The system backs off gradually to\navoid flooding your application with too many requests, but schedules retry\nattempts for failed tasks to recur at a minimum of once per hour.\n\nWorking with push queues\n------------------------\n\nWhen working with push queues, at a minimum, you'll need to do the following things:\n\n- [Create tasks\n programmatically](/appengine/docs/standard/services/taskqueue/push/creating-push-tasks) and add them to the default push queue, or to one or more named push queues that you have created.\n- [Write a\n handler](/appengine/docs/standard/services/taskqueue/push/creating-handlers) that processes a task's request, and assign the handler to an App Engine service.\n\nOptionally, you can also:\n\n- [Create and customize multiple\n queues](/appengine/docs/standard/services/taskqueue/push/creating-push-queues) to perform multiple tasks efficiently.\n- [Monitor and manage](/appengine/docs/standard/services/taskqueue/push/creating-push-queues#monitoring_queues_in_the_console_name_short) your push queues in the Google Cloud console.\n\nWhen you use push queues, your application is subject to additional\n[quotas](/appengine/docs/quotas#Task_Queue).\n\nWhat's next\n-----------\n\n- Learn how to [create push queues](/appengine/docs/standard/services/taskqueue/push/creating-push-queues).\n- Learn how to [create tasks](/appengine/docs/standard/services/taskqueue/push/creating-push-tasks).\n- Learn about [writing handlers](/appengine/docs/standard/services/taskqueue/push/creating-handlers).\n- Look at an [example](/appengine/docs/standard/services/taskqueue/push/example)."]]