File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
cloud-tasks/src/main/java/com.example.cloudtasks Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -113,8 +113,11 @@ private static Task pullTask(
113113 // Create the Cloud Tasks Client
114114 CloudTasks client = createAuthorizedClient ();
115115
116- // Create the PullTasksRequest
117- LeaseTasksRequest request = new LeaseTasksRequest ().setMaxTasks (1 ).setLeaseDuration ("600s" );
116+ // Create the LeaseTasksRequest
117+ LeaseTasksRequest request = new LeaseTasksRequest ()
118+ .setMaxTasks (1 )
119+ .setLeaseDuration ("600s" )
120+ .setResponseView ("FULL" );
118121
119122 //Execute the request and return the pulled task
120123 LeaseTasksResponse response = client
Original file line number Diff line number Diff line change @@ -62,17 +62,19 @@ export LOCATION_ID=<YOUR_ZONE>
6262export QUEUE_ID=<YOUR_QUEUE_NAME>
6363```
6464
65- Next, you can send a POST request to trigger the /create_task endpoint:
65+ Next, you can send a POST request to trigger the ` /create_task `
66+ endpoint:
6667``` bash
6768curl -d " project=$PROJECT_ID " \
6869 -d " location=$LOCATION_ID " \
6970 -d " queue=$QUEUE_ID " \
7071 -d " message=Hello World!" \
71- --request POST https://< YOUR_PROJECT_URL> .appspot.com/
72+ --request POST https://< YOUR_PROJECT_URL> .appspot.com/create_task
7273```
7374
74- This endpoint will create a Cloud Tasks to trigger the ` /log_payload `
75- endpoint, which will be visible the application's logs:
75+ This endpoint will create a Cloud Task to trigger the
76+ ` /example_task_handler ` endpoint, which will be visible the
77+ application's logs:
7678```
7779Received task with payload: Hello World!
7880```
You can’t perform that action at this time.
0 commit comments