-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
- OS type and version: google-cloud-datastore 2.33.0
- Java version: openjdk 25
Steps to reproduce
- Start a firestore emulator in datastore mode
gcloud emulators firestore start --database-mode=datastore-mode --host-port "localhost:8082" - Try to connect to it with grpc
Code example
DatastoreOptions.newBuilder()
.setHost("localhost:8082")
.setProjectId("project")
.setTransportOptions(GrpcTransportOptions.newBuilder()
.build())
.build()
.getService()The requests will go to the google apis instead of the emulator.
I think the problem is within com.google.cloud.datastore.spi.v1.GrpcDatastoreRpc
The lines https://github.com/googleapis/java-datastore/blob/83fb5cffaa091766eb0827921f2549d3e6d98363/google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/v1/GrpcDatastoreRpc.java#L82-L89 override the channelprovider unconditionally. I think they should only do that, when isEmulator(datastoreOptions) is false
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.