You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current state of the Google Cloud Spanner Quarkus extension does not work at all using the Spanner emulator. The reason is actually pretty simple: it requires valid credentials and there is no way around it, even the documented approach does not work.
A way to make it work properly with an emulator is pretty simple, and does not require the hack from the docs described in the link above.
The current code is pretty straight forward, but makes using an emulator practically impossible, because it has a hard dependency via @Inject GoogleCredentials googleCredentials;.
A way around that and the hack is to programmatically request the GoogleCredentialy and only bark, it the emulator host is not present, like in this piece of code:
In fact it can be done more elegantly by injecting an Instance<GoogleCredentials> and use instance.isAvailable(). There is multiple places where this can be done as this issue exists in multiple extensions.
The current state of the Google Cloud Spanner Quarkus extension does not work at all using the Spanner emulator. The reason is actually pretty simple: it requires valid credentials and there is no way around it, even the documented approach does not work.
A way to make it work properly with an emulator is pretty simple, and does not require the hack from the docs described in the link above.
The current code is pretty straight forward, but makes using an emulator practically impossible, because it has a hard dependency via
@Inject GoogleCredentials googleCredentials;
.A way around that and the hack is to programmatically request the
GoogleCredentialy
and only bark, it the emulator host is not present, like in this piece of code:The text was updated successfully, but these errors were encountered: