【发布时间】:2021-09-04 10:00:30
【问题描述】:
我正在开发一个 Spring Boot WebFlux 应用程序。我使用的数据库是 Cassandra,ReactiveCassandraRepository 主要用于处理数据库操作。
我需要将 Spring Batch 添加到我的项目中以处理一些长期运行的作业。但是 Spring Batch 不支持响应式模型。由于这个原因,我使用CassandraRepository 和ReactiveCassandraRepository 为每个条目创建了两个存储库。 Spring Batch 将使用通过扩展 CassandraRepository 创建的标准存储库,而 Spring Boot 应用程序的其他部分将使用非阻塞 ReactiveCassandraRepository。
如果我采用这种方法会有问题吗?我计划更新代码并扩展 AbstractCassandraConfiguration 而不是 AbstractReactiveCassandraConfiguration 来定义 Cassandra 配置,但我不确定是否应该同时使用 @EnableCassandraRepositories 和 @EnableReactiveCassandraRepositories 注释。
如果我能就此获得一些反馈,我们将不胜感激。具体来说;
- 这样评价正确吗?
- 如何在没有多个版本库的情况下在 Spring Boot WebFlux 应用程序中使用 Spring Batch?
【问题讨论】:
标签: spring-boot spring-batch spring-webflux spring-data-cassandra