Datasource Reactive url with several connections and Leader and Replica setup #50968
Unanswered
debajit-sen
asked this question in
Q&A
Replies: 1 comment
-
|
Hi @debajit-sen, this seems like a duplicate of #47698. Currently, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Team,
I have created a project with the following Quarkus dependencies:
implementation 'io.quarkus:quarkus-rest-jackson'
implementation 'io.quarkus:quarkus-hibernate-reactive-panache'
implementation 'io.quarkus:quarkus-reactive-pg-client'
I am using a PostgreSQL DB with a Leader and Replica setup, where
localhost:5432is the leader (write enabled) andlocalhost:5433is the replica (read-only mode).My
application.propertiesfile has the following configuration:quarkus.datasource.db-kind=postgresql
quarkus.datasource.reactive.url=postgresql://localhost:5432/postgres,postgresql://localhost:5433/postgres
With this configuration, during database writes, I am facing issues where some write transactions marked with
@WithTransactionare landing on the Replica DB (localhost:5433), resulting in the error:ERROR: cannot execute DELETE in a read-only transaction.For JDBC connection strings,
jdbc:postgresql://localhost:5432,localhost:5433/postgres?targetServerType=masterwithtargetServerTypeset asmasterworks correctly. Do we have something similar for defining reactive connection strings?I have not been able to find a solution so far. Any help will be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions