我尝试使用spring-boot-starter-data-r2dbc和oracle-r2dbc运行r2dbc应用程序,但它给我一个异常" org.springframework.dao.DataAccessResourceFailureException:Failed to obtain R2DBC Connection; nested exception is java.lang.IllegalStateException:This publisher does not support multiple subscribers"。
这是我的属性文件:
这是我的属性文件:
spring.r2dbc.url=r2dbc:oracle:thin://localhost:1521:orcl
spring.r2dbc.username=user
spring.r2dbc.password=password
Gradle文件中的依赖项部分:
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')
}
这里的代码部分引起了错误:
message.flatMap { fromMessage ->
Mono
.zip(
listOf(
dimensionAdviserRepository
.findFirstByEntityIdOrderByFromDateDescToDateDesc(message.adviserKey)
.map { it?.adviserKey ?: -1L }
.switchIfEmpty(Mono.just(-1L)),
dimensionAccountRepository
.findFirstByEntityIdOrderByFromDateDescToDateDesc(fromMessage.accountKey!!)
.map { it?.account_key ?: -1L }
.switchIfEmpty(Mono.just(-1L))
))}
我是否遗漏了任何配置,或者这是一个已知的限制?