Skip to content

Commit

Permalink
Use appassembler in Pub/Sub example
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard committed Jun 29, 2016
1 parent f4a41a5 commit acd4272
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
8 changes: 4 additions & 4 deletions gcloud-java-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ To run examples from your command line:
Before running the example, go to the [Google Developers Console][developers-console] to ensure that "Google Cloud Pub/Sub" is enabled.
```
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.pubsub.PubSubExample" -Dexec.args="create topic test-topic"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.pubsub.PubSubExample" -Dexec.args="create subscription test-topic test-subscription"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.pubsub.PubSubExample" -Dexec.args="publish test-topic message1 message2"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.pubsub.PubSubExample" -Dexec.args="pull sync test-subscription 2"
target/appassembler/bin/PubSubExample create topic test-topic
target/appassembler/bin/PubSubExample create subscription test-topic test-subscription
target/appassembler/bin/PubSubExample publish test-topic message1 message2
target/appassembler/bin/PubSubExample pull sync test-subscription 2
```
* Here's an example run of `ResourceManagerExample`.
Expand Down
6 changes: 6 additions & 0 deletions gcloud-java-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@
<mainClass>com.google.cloud.examples.nio.ParallelCountBytes</mainClass>
<name>ParallelCountBytes</name>
</program>
<program>
<mainClass>
com.google.cloud.examples.pubsub.PubSubExample
</mainClass>
<name>PubSubExample</name>
</program>
<program>
<mainClass>
com.google.cloud.examples.resourcemanager.ResourceManagerExample
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@
*
* <p>This example demonstrates a simple/typical Pub/Sub usage.
*
* <p>Steps needed for running the example:
* <ol>
* <li>login using gcloud SDK - {@code gcloud auth login}.</li>
* <li>compile using maven - {@code mvn compile}</li>
* <li>run using maven -
* <pre>{@code mvn exec:java -Dexec.mainClass="com.google.cloud.examples.pubsub.PubSubExample"
* <p>See the
* <a href="https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/README.md">
* README</a> for compilation instructions. Run this code with
* <pre>{@code target/appassembler/bin/PubSubExample
* -Dexec.args="[<project_id>]
* pull async <subscription> <timeoutMillis>?
* pull sync <subscription> <maxMessages>
Expand All @@ -64,8 +62,6 @@
* delete subscription <subscription>
* info topic <topic>
* info subscription <subscription>"}</pre>
* </li>
* </ol>
*
* <p>The first parameter is an optional {@code project_id} (logged-in project will be used if not
* supplied). Second parameter is a Pub/Sub operation and can be used to demonstrate its usage. For
Expand Down

0 comments on commit acd4272

Please sign in to comment.