GeezerVison is showing github.com — feat: Add universe domain support for Java by michaelpri10 · Pull Request #1904 · googleapis/java-pubsub
This repository was archived by the owner on Aug 13, 2026. It is now read-only.
Conversation
michaelpri10
commented
Feb 9, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
This adds a setUniverseDomain() method for the Publisher and Subscriber class so that users can easily set the universe domain, instead of having to create a StubSettings object. Additionally, this sets the default endpoint in the Publisher/Subscriber builders to null, which will still resolve to the default endpoint.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- Ensure the tests and linter pass
- Code coverage does not decrease (if any source code was changed)
- Appropriate docs were updated (if necessary)
Fixes: N/A ☕️
If you write sample code, please follow the samples format.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks! I think the change LGTM from my end. Were you able test this locally and connect properly?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Thanks! I think the change LGTM from my end. Were you able test this locally and connect properly?
Yes, I was able to successfully publish and subscribe when setting the universeDomain in modified versions of PublisherExample and SubscribeAsyncExample.
|
lqiu96 reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
static final long DEFAULT_COMPRESSION_BYTES_THRESHOLD = 240L;
|
|
|
|
|
|
String topicName;
|
|
|
private String endpoint = PublisherStubSettings.getDefaultEndpoint();
|
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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 the Publisher, we propagate that to the PublisherStubSettings builder, which is autogenerated. Otherwise, PublisherStubSettings uses the getDefaultEndpoint() method.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
hongalex reacted with thumbs up emoji
lqiu96
Feb 14, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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 to pubsub.googleapis.com if it is passed in.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
2 more reviewers
lqiu96
lqiu96 approved these changes
hongalex
hongalex approved these changes
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
api: pubsub
Issues related to the googleapis/java-pubsub API.
size: s
Pull request size is small.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|