1
votes

I have installed google datastore emulator in my local machine along with it written a sample spring boot application . I can't connection datastore emulator

This is my application.properties config

spring.cloud.gcp.datastore.project-id=project-id
spring.cloud.gcp.datastore.emulator.enabled=true
spring.cloud.gcp.datastore.emulator-host=http://localhost:8081

by this config , I will throw Exception

The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
1

1 Answers

0
votes

When using the Datastore emulator, you don't need credentials for running the application, so it might be that the library doesn't know that.

However, if you want to try it providing credentials, once you have a service account created, then run in the shell the following:

export GOOGLE_APPLICATION_CREDENTIALS="KEY_PATH"

KEY_PATH you have to replace it with the path of the JSON file that contains your service account key. You can find more information here.