Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pubsub: Allow to set host in the client #7095

Closed
eddumelendez opened this issue Nov 23, 2022 · 2 comments
Closed

pubsub: Allow to set host in the client #7095

eddumelendez opened this issue Nov 23, 2022 · 2 comments
Assignees
Labels
api: pubsub Issues related to the Pub/Sub API. status: investigating The issue is under investigation, which is determined to be non-trivial.

Comments

@eddumelendez
Copy link

eddumelendez commented Nov 23, 2022

Hi, I want to write a test using testcontainers-go and as you can see here java client already allows to set the host and port, which is a random port provided by testcontainers. By setting the env var we are not able to run tests in parallel.

String hostport = emulator.getEmulatorEndpoint();
ManagedChannel channel = ManagedChannelBuilder.forTarget(hostport).usePlaintext().build();
@eddumelendez eddumelendez added the triage me I really want to be triaged. label Nov 23, 2022
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Nov 23, 2022
@hongalex hongalex added status: investigating The issue is under investigation, which is determined to be non-trivial. and removed triage me I really want to be triaged. labels Dec 6, 2022
@hongalex
Copy link
Member

hongalex commented Dec 6, 2022

If I understand your concern correctly, you want to be able to specify multiple endpoints for your tests to run, while running within the same environment such that the env var option doesn't work for you, is that right?

I'm not super familiar with testcontainers, but the environment variable behavior (using PUBSUB_EMULATOR_HOST) is something we're interested in keeping. If you want to play around with custom options, you could use google.golang.org/api/option and option.WithEndpoint("localhost.com:1234") to specify a custom endpoint for your individual emulator instances when calling NewClient. You will also need to specify using insecure credentials

@eddumelendez
Copy link
Author

@hongalex thank you! I follow your suggestions. You can see it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. status: investigating The issue is under investigation, which is determined to be non-trivial.
Projects
None yet
Development

No branches or pull requests

2 participants