Feature - Spring Boot auto configuration should create Reactive and RxJava instances. #2796

pull/3505/head
Nikita Koksharov 4 years ago
parent 83bb71795c
commit e51f467812

@ -24,6 +24,8 @@ import java.util.List;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.api.RedissonReactiveClient;
import org.redisson.api.RedissonRxClient;
import org.redisson.config.Config;
import org.redisson.spring.data.connection.RedissonConnectionFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -37,6 +39,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.io.Resource;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisOperations;
@ -94,6 +97,20 @@ public class RedissonAutoConfiguration {
return new RedissonConnectionFactory(redisson);
}
@Bean
@Lazy
@ConditionalOnMissingBean(RedissonReactiveClient.class)
public RedissonReactiveClient redissonReactive(RedissonClient redisson) {
return redisson.reactive();
}
@Bean
@Lazy
@ConditionalOnMissingBean(RedissonRxClient.class)
public RedissonRxClient redissonRxJava(RedissonClient redisson) {
return redisson.rxJava();
}
@Bean(destroyMethod = "shutdown")
@ConditionalOnMissingBean(RedissonClient.class)
public RedissonClient redisson() throws IOException {

Loading…
Cancel
Save