Package org.springframework.integration.redis.outbound

Examples of org.springframework.integration.redis.outbound.RedisPublishingMessageHandler.afterPropertiesSet()


  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++) {
      handler.handleMessage(MessageBuilder.withPayload("test-" + i).build());
    }
    latch.await(3, TimeUnit.SECONDS);
    assertEquals(0, latch.getCount());
View Full Code Here


  public void testWithNoSerializer() throws Exception {
    setupListener(null);
    final RedisPublishingMessageHandler handler = new RedisPublishingMessageHandler(connectionFactory);
    handler.setBeanFactory(BusTestUtils.MOCK_BF);
    handler.setTopic(TOPIC);
    handler.afterPropertiesSet();
    for (int i = 0; i < NUM_MESSAGES; i++) {
      handler.handleMessage(MessageBuilder.withPayload(new String("test-" + i).getBytes()).build());
    }
    latch.await(3, TimeUnit.SECONDS);
    assertEquals(0, latch.getCount());
View Full Code Here

    setupListener(serializer);
    final RedisPublishingMessageHandler handler = new RedisPublishingMessageHandler(connectionFactory);
    handler.setBeanFactory(BusTestUtils.MOCK_BF);
    handler.setTopic(TOPIC);
    handler.setSerializer(serializer);
    handler.afterPropertiesSet();
    for (long i = 0; i < NUM_MESSAGES; i++) {
      handler.handleMessage(MessageBuilder.withPayload(i).build());
    }
    latch.await(3, TimeUnit.SECONDS);
    assertEquals(0, latch.getCount());
View Full Code Here

      Properties properties) {
    validateProducerProperties(name, properties, SUPPORTED_PUBSUB_PRODUCER_PROPERTIES);
    RedisPublishingMessageHandler topic = new RedisPublishingMessageHandler(connectionFactory);
    topic.setBeanFactory(this.getBeanFactory());
    topic.setTopic("topic." + name);
    topic.afterPropertiesSet();
    doRegisterProducer(name, moduleOutputChannel, topic, new RedisPropertiesAccessor(properties));
  }

  private void doRegisterProducer(final String name, MessageChannel moduleOutputChannel, MessageHandler delegate,
      RedisPropertiesAccessor properties) {
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.