Skip to content

Add Cloud Tasks Readmes #1156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 17, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update endpoint and env var
  • Loading branch information
averikitsch committed Jul 16, 2018
commit 61817585484358a65b26dd5ef3264949aa4edbc4
8 changes: 4 additions & 4 deletions appengine-java8/tasks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Set environment variables:
First, your project ID:

```
export PROJECT_ID=my-project-id
export GOOGLE_CLOUD_PROJECT=my-project-id
```

Then the queue ID, as specified at queue creation time. Queue IDs already
Expand All @@ -81,11 +81,11 @@ location is "us-central1").
export LOCATION_ID=us-central1
```

Create a task, targeted at the `log_payload` endpoint, with a payload specified:
Create a task, targeted at the `/tasks/create` endpoint, with a payload specified:

```
mvn exec:java -Dexec.mainClass="com.example.task.CreateTask" \
-Dexec.args="--project-id $PROJECT_ID --queue $QUEUE_ID --location $LOCATION_ID --payload hello"
-Dexec.args="--project-id $GOOGLE_CLOUD_PROJECT --queue $QUEUE_ID --location $LOCATION_ID --payload hello"
```

The App Engine app serves as a target for the push requests. It has an
Expand All @@ -101,5 +101,5 @@ Create a task that will be scheduled for a time in the future using the

```
mvn exec:java -Dexec.mainClass="com.example.task.CreateTask" \
-Dexec.args="--project-id $PROJECT_ID --queue $QUEUE_ID --location $LOCATION_ID --payload hello --in-seconds 30"
-Dexec.args="--project-id $GOOGLE_CLOUD_PROJECT --queue $QUEUE_ID --location $LOCATION_ID --payload hello --in-seconds 30"
```
6 changes: 3 additions & 3 deletions tasks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ mvn clean assembly:single
Optionally, you can set up your settings as environment variables:

```
export PROJECT_ID=<YOUR_PROJECT_ID>
export GOOGLE_CLOUD_PROJECT=<YOUR_PROJECT_ID>
export LOCATION_ID=<YOUR_ZONE>
export QUEUE_ID=<YOUR_QUEUE_NAME>
```
Expand All @@ -52,13 +52,13 @@ Next, create a task for a queue:

```
mvn exec:java -Dexec.mainClass="com.example.Quickstart" \
-Dexec.args="create-task --project $PROJECT_ID --queue $QUEUE_ID --location $LOCATION_ID"
-Dexec.args="create-task --project $GOOGLE_CLOUD_PROJECT --queue $QUEUE_ID --location $LOCATION_ID"
```

Finally, pull and acknowledge a task:

```
mvn exec:java -Dexec.mainClass="com.example.task.Quickstart" \
-Dexec.args="lease-and-ack-task --project $PROJECT_ID --queue $QUEUE_ID --location $LOCATION_ID"
-Dexec.args="lease-and-ack-task --project $GOOGLE_CLOUD_PROJECT --queue $QUEUE_ID --location $LOCATION_ID"
```
Note that usually, there would be a processing step in between pulling a task and acknowledging it.