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.
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.
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.
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.
Describe the solution you'd like It'd be great to make all the emulator host configuration, host format, and additional properties requirement consistent.
Or...
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
vsNoCredentials
, where to configureplaintext
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