@SpringBootTest
bean是(如果我想使用reactive,那么这就是我应该使用的bean?)
@Bean
Mono<MongoDatabase> reactiveMongoDatabase() {
// recommended way in ReactiveMongoTransactionManager javadoc
log.info("Creating reactiveMongoDatabase...");
return ReactiveMongoDatabaseUtils.getDatabase(properties.getDatabase(), reactiveMongoDatabaseFactory());
}
@Autowired
private ReactiveMongoTemplate template;
@BeforeEach
private void createColletion() {
//mongoDatabase.createCollection("Coupon");
template.createCollection(Coupon.class);
}
[ENV=itest] [productName=promotion-facts-sync] [2020-03-19T14:26:09.801Z] [ERROR] [MSG=[Thread-20] e.v.c.p.f.service.SyncProcessService - Error while processing empty message. Cause: Cannot create namespace promotion-facts-sync.Coupon in multi-document transaction.; nested exception is com.mongodb.MongoWriteException: Cannot create namespace promotion-facts-sync.Coupon in multi-document transaction. ][TRACE=] [SPAN=]
怎么做?