@Test public void createValueTemplate() throws Exception { RedisTemplate<String, EmailSchedulingData> template = emailRedisTemplateConfiguration.createValueTemplate(); assertions.assertThat(template).isNotNull(); assertions.assertThat(template.getKeySerializer()).isInstanceOf(StringRedisSerializer.class); assertions.assertThat(template.getHashKeySerializer()).isInstanceOf(StringRedisSerializer.class); assertions.assertThat(template.getHashValueSerializer()).isInstanceOf(StringRedisSerializer.class); assertions.assertThat(template.getValueSerializer()).isInstanceOf(JdkSerializationRedisSerializer.class); }
@Bean @Qualifier("valueTemplate") public RedisTemplate<String, EmailSchedulingData> createValueTemplate() throws IOException { RedisTemplate<String, EmailSchedulingData> template = new RedisTemplate<>(); RedisSerializer<String> stringSerializer = new StringRedisSerializer(); JdkSerializationRedisSerializer jdkSerializationRedisSerializer = new JdkSerializationRedisSerializer(); template.setKeySerializer(stringSerializer); template.setValueSerializer(jdkSerializationRedisSerializer); template.setHashKeySerializer(stringSerializer); template.setHashValueSerializer(stringSerializer); template.setConnectionFactory(redisConnectionFactory); template.setEnableTransactionSupport(true); template.afterPropertiesSet(); return template; }
EmailRedisTemplateConfiguration { @Bean @Qualifier("valueTemplate") public RedisTemplate<String, EmailSchedulingData> createValueTemplate() throws IOException { RedisTemplate<String, EmailSchedulingData> template = new RedisTemplate<>(); RedisSerializer<String> stringSerializer = new StringRedisSerializer(); JdkSerializationRedisSerializer jdkSerializationRedisSerializer = new JdkSerializationRedisSerializer(); template.setKeySerializer(stringSerializer); template.setValueSerializer(jdkSerializationRedisSerializer); template.setHashKeySerializer(stringSerializer); template.setHashValueSerializer(stringSerializer); template.setConnectionFactory(redisConnectionFactory); template.setEnableTransactionSupport(true); template.afterPropertiesSet(); return template; } }
EmailRedisTemplateConfiguration { @Bean @Qualifier("valueTemplate") public RedisTemplate<String, EmailSchedulingData> createValueTemplate() throws IOException { RedisTemplate<String, EmailSchedulingData> template = new RedisTemplate<>(); RedisSerializer<String> stringSerializer = new StringRedisSerializer(); JdkSerializationRedisSerializer jdkSerializationRedisSerializer = new JdkSerializationRedisSerializer(); template.setKeySerializer(stringSerializer); template.setValueSerializer(jdkSerializationRedisSerializer); template.setHashKeySerializer(stringSerializer); template.setHashValueSerializer(stringSerializer); template.setConnectionFactory(redisConnectionFactory); template.setEnableTransactionSupport(true); template.afterPropertiesSet(); return template; } @Autowired  EmailRedisTemplateConfiguration(final RedisConnectionFactory redisConnectionFactory); }
EmailRedisTemplateConfiguration { @Bean @Qualifier("valueTemplate") public RedisTemplate<String, EmailSchedulingData> createValueTemplate() throws IOException { RedisTemplate<String, EmailSchedulingData> template = new RedisTemplate<>(); RedisSerializer<String> stringSerializer = new StringRedisSerializer(); JdkSerializationRedisSerializer jdkSerializationRedisSerializer = new JdkSerializationRedisSerializer(); template.setKeySerializer(stringSerializer); template.setValueSerializer(jdkSerializationRedisSerializer); template.setHashKeySerializer(stringSerializer); template.setHashValueSerializer(stringSerializer); template.setConnectionFactory(redisConnectionFactory); template.setEnableTransactionSupport(true); template.afterPropertiesSet(); return template; } @Autowired  EmailRedisTemplateConfiguration(final RedisConnectionFactory redisConnectionFactory); @Bean @Qualifier("orderingTemplate") StringRedisTemplate createOrderingTemplate(); @Bean @Qualifier("valueTemplate") RedisTemplate<String, EmailSchedulingData> createValueTemplate(); }
EmailRedisTemplateConfiguration { @Bean @Qualifier("valueTemplate") public RedisTemplate<String, EmailSchedulingData> createValueTemplate() throws IOException { RedisTemplate<String, EmailSchedulingData> template = new RedisTemplate<>(); RedisSerializer<String> stringSerializer = new StringRedisSerializer(); JdkSerializationRedisSerializer jdkSerializationRedisSerializer = new JdkSerializationRedisSerializer(); template.setKeySerializer(stringSerializer); template.setValueSerializer(jdkSerializationRedisSerializer); template.setHashKeySerializer(stringSerializer); template.setHashValueSerializer(stringSerializer); template.setConnectionFactory(redisConnectionFactory); template.setEnableTransactionSupport(true); template.afterPropertiesSet(); return template; } @Autowired  EmailRedisTemplateConfiguration(final RedisConnectionFactory redisConnectionFactory); @Bean @Qualifier("orderingTemplate") StringRedisTemplate createOrderingTemplate(); @Bean @Qualifier("valueTemplate") RedisTemplate<String, EmailSchedulingData> createValueTemplate();  }