Examples of StringRedisSerializer


Examples of org.springframework.data.redis.serializer.StringRedisSerializer

  @Test(expected = IllegalArgumentException.class)
  public void testNoSerializerNoExtractPayload() throws Exception {
    RedisTemplate<String, byte[]> template = new RedisTemplate<String, byte[]>();
    template.setEnableDefaultSerializer(false);
    template.setKeySerializer(new StringRedisSerializer());
    template.setConnectionFactory(connectionFactory);
    template.afterPropertiesSet();

    adapter.setSerializer(null);
    adapter.setExpectMessage(true);
View Full Code Here

Examples of org.springframework.data.redis.serializer.StringRedisSerializer

  }

  @Test
  public void testCustomPayloadSerializer() throws Exception {
    RedisTemplate<String, Long> template = new RedisTemplate<String, Long>();
    template.setKeySerializer(new StringRedisSerializer());
    template.setValueSerializer(new GenericToStringSerializer<Long>(Long.class));
    template.setConnectionFactory(connectionFactory);
    template.afterPropertiesSet();

    adapter.setSerializer(new GenericToStringSerializer<Long>(Long.class));
View Full Code Here

Examples of org.springframework.data.redis.serializer.StringRedisSerializer

  }

  @Test
  public void testCustomMessageSerializer() throws Exception {
    RedisTemplate<String, Message<?>> template = new RedisTemplate<String, Message<?>>();
    template.setKeySerializer(new StringRedisSerializer());
    template.setValueSerializer(new TestMessageSerializer());
    template.setConnectionFactory(connectionFactory);
    template.afterPropertiesSet();

    adapter.setSerializer(new TestMessageSerializer());
View Full Code Here

Examples of org.springframework.data.redis.serializer.StringRedisSerializer

  }

  @Test
  public void testDefaultMsgSerializer() throws Exception {
    RedisTemplate<String, Message<?>> template = new RedisTemplate<String, Message<?>>();
    template.setKeySerializer(new StringRedisSerializer());
    template.setValueSerializer(new JdkSerializationRedisSerializer());
    template.setConnectionFactory(connectionFactory);
    template.afterPropertiesSet();

    adapter.setExtractPayload(false);
View Full Code Here

Examples of org.springframework.data.redis.serializer.StringRedisSerializer

  @Test
  public void testNoSerializer() throws Exception {
    RedisTemplate<String, byte[]> template = new RedisTemplate<String, byte[]>();
    template.setEnableDefaultSerializer(false);
    template.setKeySerializer(new StringRedisSerializer());
    template.setConnectionFactory(connectionFactory);
    template.afterPropertiesSet();

    adapter.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.data.redis.serializer.StringRedisSerializer

  @Test(expected = IllegalArgumentException.class)
  public void testNoSerializerNoExtractPayload() throws Exception {
    RedisTemplate<String, byte[]> template = new RedisTemplate<String, byte[]>();
    template.setEnableDefaultSerializer(false);
    template.setKeySerializer(new StringRedisSerializer());
    template.setConnectionFactory(connectionFactory);
    template.afterPropertiesSet();

    adapter.setSerializer(null);
    adapter.setExtractPayload(false);
View Full Code Here

Examples of org.springframework.data.redis.serializer.StringRedisSerializer

  }

  @Test
  public void testCustomPayloadSerializer() throws Exception {
    RedisTemplate<String, Long> template = new RedisTemplate<String, Long>();
    template.setKeySerializer(new StringRedisSerializer());
    template.setValueSerializer(new GenericToStringSerializer<Long>(Long.class));
    template.setConnectionFactory(connectionFactory);
    template.afterPropertiesSet();

    adapter.setSerializer(new GenericToStringSerializer<Long>(Long.class));
View Full Code Here

Examples of org.springframework.data.redis.serializer.StringRedisSerializer

  }

  @Test
  public void testCustomMessageSerializer() throws Exception {
    RedisTemplate<String, Message<?>> template = new RedisTemplate<String, Message<?>>();
    template.setKeySerializer(new StringRedisSerializer());
    template.setValueSerializer(new TestMessageSerializer());
    template.setConnectionFactory(connectionFactory);
    template.afterPropertiesSet();

    adapter.setSerializer(new TestMessageSerializer());
View Full Code Here

Examples of org.springframework.data.redis.serializer.StringRedisSerializer

    this.connectionFactory = redisAvailableRule.getResource();
  }

  @Test
  public void testWithDefaultSerializer() throws Exception {
    setupListener(new StringRedisSerializer());
    final RedisPublishingMessageHandler handler = new RedisPublishingMessageHandler(connectionFactory);
    handler.setBeanFactory(BusTestUtils.MOCK_BF);
    handler.setTopic(TOPIC);
    handler.afterPropertiesSet();
    for (int i = 0; i < NUM_MESSAGES; i++) {
View Full Code Here

Examples of org.springframework.data.redis.serializer.StringRedisSerializer

    if (this.redisTemplate != null) {
      return this.redisTemplate;
    }
    RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
    template.setConnectionFactory(this.redisAvailableRule.getResource());
    template.setKeySerializer(new StringRedisSerializer());
    template.setEnableDefaultSerializer(false);
    template.afterPropertiesSet();
    this.redisTemplate = template;
    return template;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.