Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still being used somewhere? I think it's autogenerated so it can't be removed IIRC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was added when endpoint overriding was enabled for the
Publisher
/Subscriber
here. If a user sets the endpoint when building thePublisher
, we propagate that to thePublisherStubSettings builder
, which is autogenerated. Otherwise,PublisherStubSettings
uses thegetDefaultEndpoint()
method.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To add a bit more context from the GAPICs perspective. Gax-Java now will resolve the endpoint automatically so there is no need to set a default endpoint. One of the parameters that we take into consideration is the user set endpoint which is configured from the Builder's
setEndpoint()
. All these factors (i.e. mtls, user set endpoint, user set universe domain, and more) will be considered when creating the final endpoint to be used.The reason why we're suggesting to not pass the
getDefaultEndpoint
to Gax is that Gax-Java won't be able to determine if the endpoint passed in is a user configuration or not. The new endpoint logic has user configuration override everything so it will always default topubsub.googleapis.com
if it is passed in.