com.corundumstudio.socketio.spring.boot.SocketIORedisTemplateConfiguration Maven / Gradle / Ivy
package com.corundumstudio.socketio.spring.boot;
import com.corundumstudio.socketio.store.RedisTemplateStoreFactory;
import com.corundumstudio.socketio.store.StoreFactory;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializer;
import java.io.IOException;
import java.net.UnknownHostException;
@Configuration
@AutoConfigureAfter(RedisAutoConfiguration.class)
@AutoConfigureBefore({ SocketIOServerAutoConfiguration.class})
@ConditionalOnProperty(prefix = SocketIORedisTemplateProperties.PREFIX, value = "enabled", havingValue = "true")
@EnableConfigurationProperties({ SocketIORedisTemplateProperties.class })
public class SocketIORedisTemplateConfiguration {
public RedisTemplate