I have an application runing in App engine Standar Environment done in java and accessing to the datastore with datanucleus. It is working fine and, as it is running inside the Standard Environment, it connects to datastore perfecly.
Now, I am deploying a new service for the application done in Spring Boot with the spring-cloud-gcp-data-datastore library. I have the .json file for the connection for the service account and it is working perfectly on my local environment with the gcloud beta emulator.
But now, in the production environment, when the app try to connect to the datastore, I can see the error in the logs:
com.google.cloud.datastore.DatastoreException: I/O error ... Caused by: com.google.datastore.v1.client.DatastoreException: I/O error ... Caused by: java.net.ConnectException: Connection refused (Connection refused)
Seems that the service can't connect to the datastore.
How can I see what is wrong in the connection? Is there anyway to list the connection process for the Spring boot application and datastore?
Resolved
Thanks to Mike for all his support. He gave me the key with the Spring Cloud GCP documentation.
The problem was that I must disable the configuration for the local emulator when I deploy to Production. If you don't do that, the application doesn't find the Datastore service.
Once I commented the line for the spring.cloud.gcp.datastore.host configuration (Datastore Emulator Autoconfiguration), the application worked fine in production.