Java 8 has reached end of support
and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Java 8
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Java
8 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you
migrate to the latest supported version of Java.
Using Push Queues in Java
Stay organized with collections
Save and categorize content based on your preferences.
This page provides an overview of push queues. Push queues run tasks by
dispatching HTTP requests to App Engine worker services. The requests are
delivered at a constant rate. If a task fails, the service retries the task,
sending another request. You must provide a handler for every kind of task you
use. A single service can have multiple handlers for different kinds of tasks, or
you can use different services to manage different task types.

The task deadline
When a worker service receives a push task request, it must handle the request
and send an HTTP response before a deadline that depends on the scaling
type
of the worker service.
Automatic scaling services must finish before 10 minutes have elapsed.
Manual and basic scaling services can run up to 24 hours.
An HTTP response code between 200–299 indicates success; all other values
indicate the task failed. If the task fails to respond within the deadline, or
returns an invalid response value, the task is retried.
Retrying a failed task
If a push task request handler returns an HTTP status code outside the range
200–299, or fails to return any response before the task deadline occurs, the queue
retries the task until it succeeds. The system backs off gradually to
avoid flooding your application with too many requests, but schedules retry
attempts for failed tasks to recur at a minimum of once per hour.
Working with push queues
When working with push queues, at a minimum, you'll need to do the following things:
- Create tasks
programmatically
and add them to the default push queue, or to one or more named push queues that
you have created.
- Write a
handler
that processes a task's request, and assign the handler to an App Engine
service.
Optionally, you can also:
When you use push queues, your application is subject to additional
quotas.
What's next
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-25 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 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\u003eEach task requires a handler that processes the task's request, and services can have multiple handlers for different task types.\u003c/p\u003e\n"],["\u003cp\u003eThe deadline for a worker service to respond to a task depends on its scaling type, with automatic scaling services having 10 minutes and manual/basic scaling services having up to 24 hours.\u003c/p\u003e\n"],["\u003cp\u003eA successful task response is indicated by an HTTP status code between 200-299, while any other code or a failure to respond within the deadline results in a retry.\u003c/p\u003e\n"],["\u003cp\u003eWorking with push queues involves creating tasks programmatically and assigning them to queues, as well as writing handlers to process task requests.\u003c/p\u003e\n"]]],[],null,["# Using Push Queues in Java\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| java-gen2\n|\n| /services/access). If you are updating to the App Engine Java 11/17 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/java-differences) 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/legacy/standard/java/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/legacy/standard/java/taskqueue/push/creating-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/legacy/standard/java/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/legacy/standard/java/taskqueue/push/creating-push-queues) to perform multiple tasks efficiently.\n- [Monitor and manage](/appengine/docs/legacy/standard/java/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/legacy/standard/java/taskqueue/push/creating-push-queues)\n- Learn how to [create tasks](/appengine/docs/legacy/standard/java/taskqueue/push/creating-tasks)\n- Learn about [writing handlers](/appengine/docs/legacy/standard/java/taskqueue/push/creating-handlers)\n- Look at an [example](/appengine/docs/legacy/standard/java/taskqueue/push/example)"]]