Skip to content

Commit 3b35ba7

Browse files
authored
---
yaml --- r: 7627 b: refs/heads/tswast-patch-1 c: 8c9aca4 h: refs/heads/master i: 7625: 572b219 7623: 936a2f3
1 parent 6d4c6fe commit 3b35ba7

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: 513ca7034aca5395ab4e1b7a36899ffa56566af8
60+
refs/heads/tswast-patch-1: 8c9aca409f98f910569adba836be3f83e6dd0430
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/PubSubOptions.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class PubSubOptions extends GrpcServiceOptions<PubSub, PubSubRpc, PubSubO
3232
private static final long serialVersionUID = 5640180400046623305L;
3333
private static final String PUBSUB_SCOPE = "https://www.googleapis.com/auth/pubsub";
3434
private static final Set<String> SCOPES = ImmutableSet.of(PUBSUB_SCOPE);
35+
private static final String EMULATOR_HOST_ENV_VAR = "PUBSUB_EMULATOR_HOST";
3536
private static final String DEFAULT_HOST = PublisherSettings.getDefaultServiceAddress()
3637
+ ':' + PublisherSettings.getDefaultServicePort();
3738

@@ -66,7 +67,8 @@ public PubSubRpc create(PubSubOptions options) {
6667

6768
@Override
6869
protected String defaultHost() {
69-
return DEFAULT_HOST;
70+
String host = System.getProperty(EMULATOR_HOST_ENV_VAR, System.getenv(EMULATOR_HOST_ENV_VAR));
71+
return host != null ? host : DEFAULT_HOST;
7072
}
7173

7274
public static class Builder extends

0 commit comments

Comments
 (0)