Skip to content

Commit

Permalink
Update PubSub examples, snippets and READMEs to use renamed getters/s…
Browse files Browse the repository at this point in the history
…etters/builders
  • Loading branch information
mziccard committed Oct 10, 2016
1 parent 19466be commit 43b68f5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ try (PubSub pubsub = PubSubOptions.defaultInstance().service()) {
MessageProcessor callback = new MessageProcessor() {
@Override
public void process(Message message) throws Exception {
System.out.printf("Received message \"%s\"%n", message.payloadAsString());
System.out.printf("Received message \"%s\"%n", message.getPayloadAsString());
}
};
// Create a message consumer and pull messages (for 60 seconds)
Expand Down
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ and `start` methods. This will bind a port for communication with the local Pub/
2. Create and use a `PubSub` object with the options given by the `LocalPubSubHelper` instance. For
example:
```java
PubSub localPubsub = helper.options().service();
PubSub localPubsub = helper.getOptions().service();
```

3. Run your tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ private static class CreateSubscriptionAction extends PubSubAction<SubscriptionI
@Override
public void run(PubSub pubsub, SubscriptionInfo subscription) {
pubsub.create(subscription);
System.out.printf("Created subscription %s%n", subscription.name());
System.out.printf("Created subscription %s%n", subscription.getName());
}

@Override
Expand All @@ -371,9 +371,9 @@ SubscriptionInfo parse(String... args) throws Exception {
} else if (args.length < 2) {
message = "Missing required topic or subscription name";
} else {
SubscriptionInfo.Builder builder = SubscriptionInfo.builder(args[0], args[1]);
SubscriptionInfo.Builder builder = SubscriptionInfo.newBuilder(args[0], args[1]);
if (args.length == 3) {
builder.pushConfig(PushConfig.of(args[2]));
builder.setPushConfig(PushConfig.of(args[2]));
}
return builder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void main(String... args) throws Exception {
MessageProcessor callback = new MessageProcessor() {
@Override
public void process(Message message) throws Exception {
System.out.printf("Received message \"%s\"%n", message.payloadAsString());
System.out.printf("Received message \"%s\"%n", message.getPayloadAsString());
}
};
// Create a message consumer and pull messages (for 60 seconds)
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-pubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Then, to pull messages asynchronously, use the following code:
MessageProcessor callback = new MessageProcessor() {
@Override
public void process(Message message) throws Exception {
System.out.printf("Received message \"%s\"%n", message.payloadAsString());
System.out.printf("Received message \"%s\"%n", message.getPayloadAsString());
}
};
// Create a message consumer and pull messages (for 60 seconds)
Expand Down

0 comments on commit 43b68f5

Please sign in to comment.