Skip to content

Conversation

@chingor13
Copy link
Contributor

Fixes #5792

@chingor13 chingor13 requested a review from kamalaboulhosn July 29, 2019 18:19
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 29, 2019
.setCredentialsProvider(builder.credentialsProvider)
.setExecutorProvider(FixedExecutorProvider.create(executor))
.setTransportChannelProvider(builder.channelProvider);
.setTransportChannelProvider(builder.channelProvider)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before the existence of setEndpoint, one would create a custom TransportChannelProvider and set the endpoint in there. If one does that and calls setEndpoint, which one will win?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the TransportChannelProvider#needsEndpoint(), then the value configured with setEndpoint() will take effect via TransportChannelProvider#withEndpoint(String). So a custom TransportChannelProvider that specifies an endpoint would not be overwritten.

See https://github.com/googleapis/gax-java/blob/fd5740a2726d0ab3f3124351ed0384911fa8f5c2/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java#L154-L156

@chingor13 chingor13 merged commit 34b20f8 into googleapis:master Jul 30, 2019
@chingor13 chingor13 deleted the pubsub-endpoint-override branch July 30, 2019 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PubSub: support setEndpoint on Publisher/Subscriber builders

3 participants