Package org.springframework.data.redis.core

Examples of org.springframework.data.redis.core.StringRedisTemplate


        JedisShardInfo shardInfo = new JedisShardInfo("localhost", 6379);
        connectionFactory = new JedisConnectionFactory();
        connectionFactory.setShardInfo(shardInfo);

        template = new StringRedisTemplate();
        template.setConnectionFactory(connectionFactory);
        template.afterPropertiesSet();
    }
View Full Code Here


    return redis;
  }
   
  @Bean
  public StringRedisTemplate redisTemplate() {
    return new StringRedisTemplate(redisConnectionFactory());
  }
View Full Code Here

    return new CachingConnectionFactory();
  }

  @Bean
  public StringRedisTemplate redisTemplate() {
    return new StringRedisTemplate(jedisConnectionFactory());
  }
View Full Code Here

    adapter.handleMessage(sourceMessage);
  }

  @After
  public void cleanupQueue() {
    StringRedisTemplate template = new StringRedisTemplate(redisAvailableRule.getResource());
    template.delete(deployerQueue);
  }
View Full Code Here

    }
  }

  @Override
  protected AbstractRedisRepository<String, Integer> createRepository() {
    return new AbstractRedisRepository<String, Integer>("_test", new StringRedisTemplate(connectionFactory)) {

      @Override
      protected String serializeId(Integer id) {
        // Need padding to be comparable
        return String.format("%05d", id);
View Full Code Here

    connectionFactory.getConnection().del(QUEUE_NAME.getBytes());
  }

  @Test
  public void testDefaultPayloadSerializer() throws Exception {
    StringRedisTemplate template = new StringRedisTemplate(connectionFactory);
    template.afterPropertiesSet();

    adapter.afterPropertiesSet();
    adapter.handleMessage(new GenericMessage<String>("message1"));
    assertEquals("message1", template.boundListOps(QUEUE_NAME).rightPop());
  }
View Full Code Here

    return new RedisAggregateCounterRepository(redisConnectionFactory());
  }

  @Bean
  public StringRedisTemplate stringRedisTemplate() {
    return new StringRedisTemplate(redisConnectionFactory());
  }
View Full Code Here

public class RedisTestMessageBus extends AbstractTestMessageBus<RedisMessageBus> {

  private StringRedisTemplate template;

  public RedisTestMessageBus(RedisConnectionFactory connectionFactory) {
    template = new StringRedisTemplate(connectionFactory);
  }
View Full Code Here

        IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME,
        channelRegistry);
    context.refresh();
    messageBus.setApplicationContext(context);
    setMessageBus(messageBus);
    template = new StringRedisTemplate(connectionFactory);
  }
View Full Code Here

    singleNodeApplication.close();
  }

  @Override
  protected void verifyOnDemandQueues(MessageChannel y3, MessageChannel z3) {
    StringRedisTemplate template = new StringRedisTemplate(redisAvailableRule.getResource());
    String y = template.boundListOps("queue.queue:y").rightPop();
    assertNotNull(y);
    assertTrue(y.endsWith("y")); // bus headers
    String z = template.boundListOps("queue.queue:z").rightPop();
    assertNotNull(z);
    assertTrue(z.endsWith("z")); // bus headers
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.redis.core.StringRedisTemplate

Copyright © 2018 www.massapicom. 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.