diff --git a/firestore/runtime/src/main/java/io/quarkiverse/googlecloudservices/firestore/runtime/FirestoreConfiguration.java b/firestore/runtime/src/main/java/io/quarkiverse/googlecloudservices/firestore/runtime/FirestoreConfiguration.java index 396ac312..d59392bd 100644 --- a/firestore/runtime/src/main/java/io/quarkiverse/googlecloudservices/firestore/runtime/FirestoreConfiguration.java +++ b/firestore/runtime/src/main/java/io/quarkiverse/googlecloudservices/firestore/runtime/FirestoreConfiguration.java @@ -25,6 +25,13 @@ public class FirestoreConfiguration { @ConfigItem public Optional retry; + /** + * The firestore database identifier. + * It not set, the default will be used. + */ + @ConfigItem + public Optional databaseId; + @ConfigGroup public static class RetryConfiguration { diff --git a/firestore/runtime/src/main/java/io/quarkiverse/googlecloudservices/firestore/runtime/FirestoreProducer.java b/firestore/runtime/src/main/java/io/quarkiverse/googlecloudservices/firestore/runtime/FirestoreProducer.java index 77a9e2e4..383e3d4d 100644 --- a/firestore/runtime/src/main/java/io/quarkiverse/googlecloudservices/firestore/runtime/FirestoreProducer.java +++ b/firestore/runtime/src/main/java/io/quarkiverse/googlecloudservices/firestore/runtime/FirestoreProducer.java @@ -41,6 +41,7 @@ public Firestore firestore() throws IOException { .setProjectId(gcpConfiguration.projectId().orElse(null)); firestoreConfiguration.hostOverride.ifPresent(builder::setHost); firestoreConfiguration.retry.ifPresent(retry -> builder.setRetrySettings(buildRetrySettings(retry))); + firestoreConfiguration.databaseId.ifPresent(databaseId -> builder.setDatabaseId(databaseId)); return builder.build().getService(); }