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.

Creating Pull Tasks

Once you have created a pull queue, you can create tasks and add them to the queue.

First you need the name of the queue, which is defined in queue.xml. Then you use the builder and TaskOptions.Method.PULL to add the task. The following example puts tasks in a pull queue named pull-queue:

First, get the queue using the queue name defined in the queue.xml:

Queueq=QueueFactory.getQueue("pull-queue");

Then use the queue's add() method with TaskOptions.Method.PULL to place tasks in a pull queue named pull-queue:

q.add(
TaskOptions.Builder.withMethod(TaskOptions.Method.PULL).payload(content.toString()));

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年10月30日 UTC.