oracle-r2dbc
oracle-r2dbc copied to clipboard
Failed to obtain R2DBC, this publisher does not support multiple subscribers
I try to run r2dbc application with spring-boot-starter-data-r2dbc and oracle-r2dbc but it gives me an exception " org.springframework.dao.DataAccessResourceFailureException: Failed to obtain R2DBC Connection; nested exception is java.lang.IllegalStateException: This publisher does not support multiple subscribers".
Here is my properties file:
spring.r2dbc.url=r2dbc:oracle:thin://localhost:1521:orcl spring.r2dbc.username=user spring.r2dbc.password=password
and dependenices part of gradle file:
dependencies { ktlint 'com.pinterest:ktlint:0.41.0' implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion") implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") implementation('com.fasterxml.jackson.module:jackson-module-kotlin') implementation('org.codehaus.janino:janino') implementation('org.springframework.cloud:spring-cloud-starter-stream-kafka') implementation('org.springframework.cloud:spring-cloud-stream') implementation('org.springframework.boot:spring-boot-configuration-processor') implementation('org.apache.httpcomponents:httpclient:4.5.8') implementation('org.springframework.retry:spring-retry') implementation("org.springframework.boot:spring-boot-starter-webflux") implementation('org.springframework.boot:spring-boot-starter-data-r2dbc') implementation('com.oracle.database.r2dbc:oracle-r2dbc') implementation('com.oracle.database.jdbc:ojdbc11:21.1.0.0') }
Am I missing any configuration or is this a known limitation?
Hi @xuandungdoan, this is a known issue with v0.1.0 of Oracle R2DBC. The ConnectionFactory.create() Publisher did not support multiple subscribers. This has been fixed since v0.2.0.
However, I don't think Spring currently supports the newer versions of Oracle R2DBC. The newer versions are implementing milestone releases of the 0.9 R2DBC SPI, and I believe that Spring only supports the 0.8 SPI at the moment.
A general availability (GA) release of the 0.9 R2DBC SPI is planned for November. After the GA release, I think it's probable that Spring would add support for 0.9.
I'll leave this issue open so that other Spring programmers can find it easily.
Closing this issue as it has been resolved in newer releases. If anyone is still facing this: Please update to a newer Oracle R2DBC release.