Examples of bindProducer()


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

  @Test
  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() {
View Full Code Here

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

  }

  @Test
  public void testProducerProperties() throws Exception {
    MessageBus bus = getMessageBus();
    bus.bindProducer("props.0", new DirectChannel(), null);
    @SuppressWarnings("unchecked")
    List<Binding> bindings = TestUtils.getPropertyValue(bus, "messageBus.bindings", List.class);
    assertEquals(1, bindings.size());
    AbstractEndpoint endpoint = bindings.get(0).getEndpoint();
    assertEquals("xdbus.props.0", TestUtils.getPropertyValue(endpoint, "handler.delegate.routingKey"));
View Full Code Here

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

    properties.put("partitionKeyExtractorClass", "foo");
    properties.put("partitionSelectorExpression", "0");
    properties.put("partitionSelectorClass", "foo");
    properties.put("partitionCount", "1");

    bus.bindProducer("props.0", new DirectChannel(), properties);
    assertEquals(1, bindings.size());
    endpoint = bindings.get(0).getEndpoint();
    assertEquals(
        "'foo.props.0-' + headers['partition']",
        TestUtils.getPropertyValue(endpoint, "handler.delegate.routingKeyExpression", SpelExpression.class).getExpressionString());
View Full Code Here

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

          containsString("partitionKeyExpression"),
          containsString("partitionSelectorClass")));
      assertThat(e.getMessage(), containsString("for dummy."));
    }
    try {
      bus.bindProducer("queue:dummy", new DirectChannel(), properties);
      fail("Expected exception");
    }
    catch (IllegalArgumentException e) {
      assertThat(e.getMessage(), allOf(
          containsString("RabbitMessageBus does not support producer properties: "),
View Full Code Here

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

    assertFalse(singleNodeApplication.pluginContext().containsBean("queue:y"));
    assertFalse(singleNodeApplication.pluginContext().containsBean("queue:z"));


    DirectChannel testChannel = new DirectChannel();
    bus.bindProducer("queue:x", testChannel, null);
    testChannel.send(MessageBuilder.withPayload("y").build());
    Thread.sleep(2000);

    singleNodeApplication.pluginContext().getBean("queue:y", MessageChannel.class);
    assertFalse(singleNodeApplication.pluginContext().containsBean("queue:z"));
View Full Code Here

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

  }

  @Test
  public void testProducerProperties() throws Exception {
    MessageBus bus = getMessageBus();
    bus.bindProducer("props.0", new DirectChannel(), null);
    @SuppressWarnings("unchecked")
    List<Binding> bindings = TestUtils.getPropertyValue(bus, "messageBus.bindings", List.class);
    assertEquals(1, bindings.size());
    AbstractEndpoint endpoint = bindings.get(0).getEndpoint();
    assertEquals(
View Full Code Here

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

    properties.put("partitionKeyExtractorClass", "foo");
    properties.put("partitionSelectorExpression", "0");
    properties.put("partitionSelectorClass", "foo");
    properties.put("partitionCount", "1");

    bus.bindProducer("props.0", new DirectChannel(), properties);
    assertEquals(1, bindings.size());
    endpoint = bindings.get(0).getEndpoint();
    assertEquals(
        "'queue.props.0-' + headers['partition']",
        TestUtils.getPropertyValue(endpoint, "handler.delegate.queueNameExpression", Expression.class).getExpressionString());
View Full Code Here

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

          containsString("partitionKeyExpression"),
          containsString("partitionSelectorClass")));
      assertThat(e.getMessage(), containsString("for dummy."));
    }
    try {
      bus.bindProducer("queue:dummy", new DirectChannel(), properties);
      fail("Expected exception");
    }
    catch (IllegalArgumentException e) {
      assertThat(e.getMessage(), allOf(
          containsString("RedisMessageBus does not support producer properties: "),
View Full Code Here

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

  @Test
  public void testRetryFail() {
    MessageBus bus = getMessageBus();
    DirectChannel channel = new DirectChannel();
    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
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.