From 9d390a2a7afb221a31fc3e0f6fccc0c39a58f78c Mon Sep 17 00:00:00 2001 From: Kurtis Van Gent Date: Tue, 13 Feb 2018 11:30:45 -0800 Subject: [PATCH 1/2] Set ResponseView to full. --- .../src/main/java/com.example.cloudtasks/PullQueue.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 From 50273b985518faf85c034b38d6d07d2ee0a9fb9c Mon Sep 17 00:00:00 2001 From: Kurtis Van Gent Date: Tue, 13 Feb 2018 14:45:09 -0800 Subject: [PATCH 2/2] Correct mistake in README for flex app. --- flexible/cloud-tasks/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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