From 48e0938590fecd3b452825d8e88e894d8c2f8f8b Mon Sep 17 00:00:00 2001 From: Andreas Gabor Date: Wed, 9 Oct 2024 11:53:58 +0200 Subject: [PATCH] allow globally set settings for query plugin --- .../src/main/resources/reference.conf | 2 ++ .../persistence/projection/r2dbc/R2dbcProjection.scala | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 akka-components-persistence-projection-r2dbc/src/main/resources/reference.conf diff --git a/akka-components-persistence-projection-r2dbc/src/main/resources/reference.conf b/akka-components-persistence-projection-r2dbc/src/main/resources/reference.conf new file mode 100644 index 0000000..6257321 --- /dev/null +++ b/akka-components-persistence-projection-r2dbc/src/main/resources/reference.conf @@ -0,0 +1,2 @@ +# override this to use custom settings for the default query plugin +net.sc8s.akka.components.persistence.projection.r2dbc.default = ${akka.persistence.r2dbc} \ No newline at end of file diff --git a/akka-components-persistence-projection-r2dbc/src/main/scala/net/sc8s/akka/components/persistence/projection/r2dbc/R2dbcProjection.scala b/akka-components-persistence-projection-r2dbc/src/main/scala/net/sc8s/akka/components/persistence/projection/r2dbc/R2dbcProjection.scala index 15c5842..14dd6fe 100644 --- a/akka-components-persistence-projection-r2dbc/src/main/scala/net/sc8s/akka/components/persistence/projection/r2dbc/R2dbcProjection.scala +++ b/akka-components-persistence-projection-r2dbc/src/main/scala/net/sc8s/akka/components/persistence/projection/r2dbc/R2dbcProjection.scala @@ -23,8 +23,8 @@ private[r2dbc] trait R2dbcProjection extends EventSourcedT.ProjectionT { val numberOfProjectionInstances = 1 - // override this if you e.g. want to use a readonly endpoint for the projections https://discuss.lightbend.com/t/r2dbc-projections-use-read-only-hot-standby-replicas-for-projections-query/10860 - val readJournalPluginId = R2dbcReadJournal.Identifier + // override this if you e.g. want to use a readonly endpoint for the projections https://discuss.lightbend.com/t/r2dbc-projections-use-read-only-hot-standby-replicas-for-projections-query/10860 . or override it in the config to customize all projections + val readJournalPluginId = "net.sc8s.akka.components.persistence.projection.r2dbc.default" } object R2dbcProjection {