Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

FR - More consistent emulator support #2589

Closed
saturnism opened this issue Nov 11, 2020 · 1 comment
Closed

FR - More consistent emulator support #2589

saturnism opened this issue Nov 11, 2020 · 1 comment
Labels

Comments

@saturnism
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I created examples for testing w/ emulators using testcontainers for datastore, firestore, pubsub, and spanner.

https://github.com/saturnism/testcontainers-gcloud-examples/tree/main/springboot

It took sometimes to figure out how to configure each starter to use the emulator correctly, mostly due to inconsistencies. This issue tracks the inconsistencies and proposed for a more consistent configuration for all emulators.

Starter Emulator host Host Format Additional Properties
Datastore spring.cloud.gcp.datastore.host http://host:port
Firestore spring.cloud.gcp.firestore.host-port host:port spring.cloud.gcp.firestore.emulator.enabled=true
Spanner spring.cloud.gcp.spanner.emulator-host host:port spring.cloud.gcp.spanner.emulator.enabled=true
PubSub spring.cloud.gcp.pubsub.emulator-host host:port

Describe the solution you'd like
It'd be great to make all the emulator host configuration, host format, and additional properties requirement consistent.

Starter Emulator host Host Format Additional Properties
Datastore spring.cloud.gcp.datastore.emulator-host host:port
Firestore spring.cloud.gcp.firestore.emulator-host host:port
Spanner spring.cloud.gcp.spanner.emulator-host host:port
PubSub spring.cloud.gcp.pubsub.emulator-host host:port

Or...

Starter Emulator host Host Format Additional Properties
Datastore spring.cloud.gcp.datastore.host-port host:port spring.cloud.gcp.datastore.emulator.enabled=true
Firestore spring.cloud.gcp.firestore.host-port host:port spring.cloud.gcp.datastore.emulator.enabled=true
Spanner spring.cloud.gcp.spanner.host-port host:port spring.cloud.gcp.datastore.emulator.enabled=true
PubSub spring.cloud.gcp.pubsub.host-port host:port spring.cloud.gcp.datastore.emulator.enabled=true

This would conflict w/ the existing datastore emulator support, however. But that also means if we keep "emulator.enabled", it should only mean it if Spring Cloud GCP launches the emulator automatically (like Datastore)

However, I think the challenge is mostly in the underlying client libraries as well. There are some significant inconsistencies for client libraries regarding the use of EmualtorCredentials vs NoCredentials, where to configure plaintext for managed channel, and the host name, etc.

Describe alternatives you've considered
N/A

Additional context
https://github.com/saturnism/testcontainers-gcloud-examples/tree/main/springboot

@meltsufin
Copy link
Contributor

Migrated to: GoogleCloudPlatform/spring-cloud-gcp#159

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants