Skip to content

Commit 655b74d

Browse files
Pub/Sub: add --region to command to start dataflow job (GoogleCloudPlatform#4448)
* add --region to command to start dataflow job * use a variable for region * remove $ in command
1 parent f868a75 commit 655b74d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pubsub/streaming-analytics/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ Sample(s) showing how to use [Google Cloud Pub/Sub] with [Google Cloud Dataflow]
6161
gcloud scheduler jobs run publisher-job
6262
```
6363

64+
1. Set `REGION` to a Dataflow [regional endpoint].
65+
66+
```
67+
export REGION=your-cloud-region
68+
```
69+
6470
## Setup
6571
6672
The following instructions will help you prepare your development environment.
@@ -91,6 +97,7 @@ The following instructions will help you prepare your development environment.
9197
The following example will run a streaming pipeline. It will read messages from a Pub/Sub topic, then window them into fixed-sized intervals, and write one file per window into a GCS location.
9298

9399
+ `--project`: sets the Google Cloud project ID to run the pipeline on
100+
+ `--region`: sets the Dataflow regional endpoint
94101
+ `--inputTopic`: sets the input Pub/Sub topic to read messages from
95102
+ `--output`: sets the output GCS path prefix to write files to
96103
+ `--runner [optional]`: specifies the runner to run the pipeline, defaults to `DirectRunner`
@@ -102,6 +109,7 @@ mvn compile exec:java \
102109
-Dexec.cleanupDaemonThreads=false \
103110
-Dexec.args="\
104111
--project=$PROJECT_NAME \
112+
--region=$REGION \
105113
--inputTopic=projects/$PROJECT_NAME/topics/cron-topic \
106114
--output=gs://$BUCKET_NAME/samples/output \
107115
--runner=DataflowRunner \
@@ -164,3 +172,5 @@ gsutil ls gs://$BUCKET_NAME/samples/
164172
[GCP Console create Dataflow job page]: https://console.cloud.google.com/dataflow/createjob
165173
[GCP Console Dataflow page]: https://console.cloud.google.com/dataflow
166174
[GCP Console Storage page]: https://console.cloud.google.com/storage
175+
176+
[regional endpoint]: https://cloud.google.com/dataflow/docs/concepts/regional-endpoints

0 commit comments

Comments
 (0)