Examples of bindConsumer()


Examples of org.springframework.xd.dirt.integration.bus.MessageBus.bindConsumer()

  public void testSendAndReceiveBad() throws Exception {
    MessageBus messageBus = getMessageBus();
    DirectChannel moduleOutputChannel = new DirectChannel();
    DirectChannel moduleInputChannel = new DirectChannel();
    messageBus.bindProducer("bad.0", moduleOutputChannel, null);
    messageBus.bindConsumer("bad.0", moduleInputChannel, null);
    Message<?> message = MessageBuilder.withPayload("bad").setHeader(MessageHeaders.CONTENT_TYPE, "foo/bar").build();
    final CountDownLatch latch = new CountDownLatch(3);
    moduleInputChannel.subscribe(new MessageHandler() {

      @Override
View Full Code Here

Examples of org.springframework.xd.dirt.integration.bus.MessageBus.bindConsumer()

  @Test
  public void testConsumerProperties() throws Exception {
    MessageBus bus = getMessageBus();
    Properties properties = new Properties();
    properties.put("transacted", "true"); // test transacted with defaults; not allowed with ackmode NONE
    bus.bindConsumer("props.0", new DirectChannel(), properties);
    @SuppressWarnings("unchecked")
    List<Binding> bindings = TestUtils.getPropertyValue(bus, "messageBus.bindings", List.class);
    assertEquals(1, bindings.size());
    AbstractEndpoint endpoint = bindings.get(0).getEndpoint();
    SimpleMessageListenerContainer container = TestUtils.getPropertyValue(endpoint, "messageListenerContainer",
View Full Code Here

Examples of org.springframework.xd.dirt.integration.bus.MessageBus.bindConsumer()

    properties.put("prefetch", "20");
    properties.put("requestHeaderPatterns", "foo");
    properties.put("requeue", "false");
    properties.put("txSize", "10");
    properties.put("partitionIndex", 0);
    bus.bindConsumer("props.0", new DirectChannel(), properties);

    @SuppressWarnings("unchecked")
    List<Binding> bindingsNow = TestUtils.getPropertyValue(bus, "messageBus.bindings", List.class);
    assertEquals(1, bindingsNow.size());
    endpoint = bindingsNow.get(0).getEndpoint();
View Full Code Here

Examples of org.springframework.xd.dirt.integration.bus.MessageBus.bindConsumer()

          containsString("partitionIndex"),
          containsString("concurrency"),
          containsString(" for dummy.")));
    }
    try {
      bus.bindConsumer("queue:dummy", null, properties);
      fail("Expected exception");
    }
    catch (IllegalArgumentException e) {
      assertEquals("RabbitMessageBus does not support consumer property: partitionIndex for queue:dummy.",
          e.getMessage());
View Full Code Here

Examples of org.springframework.xd.dirt.integration.bus.MessageBus.bindConsumer()

      public void handleMessage(Message<?> message) throws MessagingException {
        throw new RuntimeException("foo");
      }

    });
    bus.bindConsumer("dlqtest", moduleInputChannel, properties);

    RabbitTemplate template = new RabbitTemplate(this.rabbitAvailableRule.getResource());
    template.convertAndSend("", "xdbustest.dlqtest", "foo");

    int n = 0;
View Full Code Here

Examples of org.springframework.xd.dirt.integration.bus.MessageBus.bindConsumer()

  @Test
  public void testConsumerProperties() throws Exception {
    MessageBus bus = getMessageBus();
    Properties properties = new Properties();
    properties.put("maxAttempts", "1"); // disable retry
    bus.bindConsumer("props.0", new DirectChannel(), properties);
    @SuppressWarnings("unchecked")
    List<Binding> bindings = TestUtils.getPropertyValue(bus, "messageBus.bindings", List.class);
    assertEquals(1, bindings.size());
    AbstractEndpoint endpoint = bindings.get(0).getEndpoint();
    assertThat(endpoint, instanceOf(RedisQueueMessageDrivenEndpoint.class));
View Full Code Here

Examples of org.springframework.xd.dirt.integration.bus.MessageBus.bindConsumer()

    properties.put("backOffMultiplier", "5.0");
    properties.put("concurrency", "2");
    properties.put("maxAttempts", "23");
    properties.put("partitionIndex", 0);

    bus.bindConsumer("props.0", new DirectChannel(), properties);
    assertEquals(1, bindings.size());
    endpoint = bindings.get(0).getEndpoint();
    verifyConsumer(endpoint);

    try {
View Full Code Here

Examples of org.springframework.xd.dirt.integration.bus.MessageBus.bindConsumer()

          containsString("partitionIndex"),
          containsString("concurrency"),
          containsString(" for dummy.")));
    }
    try {
      bus.bindConsumer("queue:dummy", null, properties);
      fail("Expected exception");
    }
    catch (IllegalArgumentException e) {
      assertEquals("RedisMessageBus does not support consumer property: partitionIndex for queue:dummy.",
          e.getMessage());
View Full Code Here

Examples of org.springframework.xd.dirt.integration.bus.MessageBus.bindConsumer()

    bus.bindProducer("retry.0", channel, null);
    Properties props = new Properties();
    props.put("maxAttempts", 2);
    props.put("backOffInitialInterval", 100);
    props.put("backOffMultiplier", "1.0");
    bus.bindConsumer("retry.0", new DirectChannel(), props); // no subscriber
    channel.send(new GenericMessage<String>("foo"));
    RedisTemplate<String, Object> template = createTemplate();
    Object rightPop = template.boundListOps("ERRORS:retry.0").rightPop(5, TimeUnit.SECONDS);
    assertNotNull(rightPop);
    assertThat(new String((byte[]) rightPop), containsString("foo"));
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.