Package org.springframework.xd.dirt.integration.bus

Examples of org.springframework.xd.dirt.integration.bus.MessageBus


    assertEquals(5.0, TestUtils.getPropertyValue(retry, "backOffPolicy.multiplier"));
  }

  @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
    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


  }

  @Override
  protected void checkBusBound(MessageBus bus) {
    if (bus instanceof RabbitTestMessageBus) {
      MessageBus msgBus = ((RabbitTestMessageBus) bus).getCoreMessageBus();
      assertEquals(4, TestUtils.getPropertyValue(msgBus, "bindings", Collection.class).size());
    }
  }
View Full Code Here

  }

  @Override
  protected void checkBusUnbound(MessageBus bus) {
    if (bus instanceof RabbitTestMessageBus) {
      MessageBus msgBus = ((RabbitTestMessageBus) bus).getCoreMessageBus();
      assertEquals(0, TestUtils.getPropertyValue(msgBus, "bindings", Collection.class).size());
    }
  }
View Full Code Here

    String streamName = "test";

    StreamDefinition testStream = new StreamDefinition(streamName, streamDefinition);
    integrationSupport.createAndDeployStream(testStream);

    MessageBus messageBus = integrationSupport.messageBus();

    NamedChannelSource source = new SingleNodeNamedChannelSourceFactory(messageBus).createNamedChannelSource("queue:producer");
    NamedChannelSink sink = new SingleNodeNamedChannelSinkFactory(messageBus).createNamedChannelSink("queue:consumer");

    source.sendPayload("hello");
View Full Code Here

TOP

Related Classes of org.springframework.xd.dirt.integration.bus.MessageBus

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.