Skip to content

Commit b25c462

Browse files
mziccardaozarov
authored andcommitted
Change pubsub endpoint from pubsub-experimental to pubsub (#1149)
1 parent 0637c80 commit b25c462

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/PubSubOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class PubSubOptions extends GrpcServiceOptions<PubSub, PubSubRpc, PubSubO
3131
private static final long serialVersionUID = 5640180400046623305L;
3232
private static final String PUBSUB_SCOPE = "https://www.googleapis.com/auth/pubsub";
3333
private static final Set<String> SCOPES = ImmutableSet.of(PUBSUB_SCOPE);
34-
private static final String DEFAULT_HOST = "https://pubsub.googleapis.com";
34+
private static final String DEFAULT_HOST = "pubsub.googleapis.com";
3535

3636
public static class DefaultPubSubFactory implements PubSubFactory {
3737
private static final PubSubFactory INSTANCE = new DefaultPubSubFactory();

gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/spi/DefaultPubSubRpc.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import static com.google.common.base.MoreObjects.firstNonNull;
2020

21+
import com.google.api.gax.core.ConnectionSettings;
2122
import com.google.api.gax.core.RetrySettings;
2223
import com.google.api.gax.grpc.ApiCallSettings;
2324
import com.google.api.gax.grpc.ApiException;
@@ -139,10 +140,20 @@ public DefaultPubSubRpc(PubSubOptions options) throws IOException {
139140
subBuilder.provideChannelWith(channel, true);
140141
} else {
141142
GoogleCredentials credentials = options.authCredentials().credentials();
142-
pubBuilder.provideChannelWith(
143-
credentials.createScoped(PublisherSettings.DEFAULT_SERVICE_SCOPES));
144-
subBuilder.provideChannelWith(
145-
credentials.createScoped(SubscriberSettings.DEFAULT_SERVICE_SCOPES));
143+
ConnectionSettings pubConnectionSettings = ConnectionSettings.newBuilder()
144+
.setServiceAddress(options.host())
145+
.setPort(PublisherSettings.DEFAULT_SERVICE_PORT)
146+
.provideCredentialsWith(
147+
credentials.createScoped(PublisherSettings.DEFAULT_SERVICE_SCOPES))
148+
.build();
149+
ConnectionSettings subConnectionSettings = ConnectionSettings.newBuilder()
150+
.setServiceAddress(options.host())
151+
.setPort(SubscriberSettings.DEFAULT_SERVICE_PORT)
152+
.provideCredentialsWith(
153+
credentials.createScoped(SubscriberSettings.DEFAULT_SERVICE_SCOPES))
154+
.build();
155+
pubBuilder.provideChannelWith(pubConnectionSettings);
156+
subBuilder.provideChannelWith(subConnectionSettings);
146157
}
147158
pubBuilder.applyToAllApiMethods(apiCallSettings(options));
148159
subBuilder.applyToAllApiMethods(apiCallSettings(options));

0 commit comments

Comments
 (0)