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(
113
113
// Create the Cloud Tasks Client
114
114
CloudTasks client = createAuthorizedClient ();
115
115
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" );
118
121
119
122
//Execute the request and return the pulled task
120
123
LeaseTasksResponse response = client
Original file line number Diff line number Diff line change @@ -62,17 +62,19 @@ export LOCATION_ID=<YOUR_ZONE>
62
62
export QUEUE_ID=<YOUR_QUEUE_NAME>
63
63
```
64
64
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:
66
67
``` bash
67
68
curl -d " project=$PROJECT_ID " \
68
69
-d " location=$LOCATION_ID " \
69
70
-d " queue=$QUEUE_ID " \
70
71
-d " message=Hello World!" \
71
- --request POST https://< YOUR_PROJECT_URL> .appspot.com/
72
+ --request POST https://< YOUR_PROJECT_URL> .appspot.com/create_task
72
73
```
73
74
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:
76
78
```
77
79
Received task with payload: Hello World!
78
80
```
You can’t perform that action at this time.
0 commit comments