public class PubSubExample extends Object
This example demonstrates a simple/typical Pub/Sub usage.
See the README for compilation instructions. Run this code with
target/appassembler/bin/PubSubExample
-Dexec.args="[<project_id>]
pull async <subscription> <timeoutMillis>?
pull sync <subscription> <maxMessages>
publish <topic> <message>+
replace-push-config <subscription> <endpoint>?
ack <subscription> <ackId>+
nack <subscription> <ackId>+
create topic <topic>
create subscription <topic> <subscription> <endpoint>?
list subscriptions <topic>?
list topics
delete topic <topic>
delete subscription <subscription>
info topic <topic>
info subscription <subscription>"
The first parameter is an optional 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
operations that apply to more than one entity (`list`, `create`, `info` and `delete`) the third
parameter specifies the entity. `pull` operation also takes a third parameter to specify whether
pulling should be synchronous or asynchronous.
| Constructor and Description |
|---|
PubSubExample() |
Copyright © 2016 Google. All rights reserved.