diff --git a/cloud-tasks/src/main/java/com.example.cloudtasks/PullQueue.java b/cloud-tasks/src/main/java/com.example.cloudtasks/PullQueue.java index f6e01af6d13..ef5e461f8c2 100644 --- a/cloud-tasks/src/main/java/com.example.cloudtasks/PullQueue.java +++ b/cloud-tasks/src/main/java/com.example.cloudtasks/PullQueue.java @@ -113,8 +113,11 @@ private static Task pullTask( // Create the Cloud Tasks Client CloudTasks client = createAuthorizedClient(); - // Create the PullTasksRequest - LeaseTasksRequest request = new LeaseTasksRequest().setMaxTasks(1).setLeaseDuration("600s"); + // Create the LeaseTasksRequest + LeaseTasksRequest request = new LeaseTasksRequest() + .setMaxTasks(1) + .setLeaseDuration("600s") + .setResponseView("FULL"); //Execute the request and return the pulled task LeaseTasksResponse response = client diff --git a/flexible/cloud-tasks/README.md b/flexible/cloud-tasks/README.md index 6e47e80f9aa..4374bccc435 100644 --- a/flexible/cloud-tasks/README.md +++ b/flexible/cloud-tasks/README.md @@ -62,17 +62,19 @@ export LOCATION_ID= export QUEUE_ID= ``` -Next, you can send a POST request to trigger the /create_task endpoint: +Next, you can send a POST request to trigger the `/create_task` +endpoint: ```bash curl -d "project=$PROJECT_ID" \ -d "location=$LOCATION_ID" \ -d "queue=$QUEUE_ID" \ -d "message=Hello World!" \ - --request POST https://.appspot.com/ + --request POST https://.appspot.com/create_task ``` -This endpoint will create a Cloud Tasks to trigger the `/log_payload` -endpoint, which will be visible the application's logs: +This endpoint will create a Cloud Task to trigger the +`/example_task_handler` endpoint, which will be visible the +application's logs: ``` Received task with payload: Hello World! ``` \ No newline at end of file