Examples of StreamDefinition


Examples of org.springframework.xd.dirt.stream.StreamDefinition

    Assert.hasText(streamName, "streamName cannot be null or empty");
    Assert.hasText(moduleResourceLocation, "moduleResourceLocation cannot be null or empty");
    this.integrationSupport = new SingleNodeIntegrationTestSupport(application);
    this.integrationSupport.addModuleRegistry(new ArchiveModuleRegistry(moduleResourceLocation));
    String streamDefinition = buildStreamDefinition(processingChain);
    stream = new StreamDefinition(streamName, streamDefinition);

    integrationSupport.createAndDeployStream(stream);

    messageBus = integrationSupport.messageBus();
    this.sink = createSink() ? new SingleNodeNamedQueueSink(messageBus, QUEUE_CONSUMER) : null;
View Full Code Here

Examples of org.springframework.xd.dirt.stream.StreamDefinition

    try {
      Stat definitionStat = client.checkExists().forPath(path);
      if (definitionStat != null) {
        byte[] data = client.getData().forPath(path);
        Map<String, String> map = ZooKeeperUtils.bytesToMap(data);
        Stream stream = new Stream(new StreamDefinition(id, map.get("definition")));

        Stat deployStat = client.checkExists().forPath(Paths.build(Paths.STREAM_DEPLOYMENTS, id));
        if (deployStat != null) {
          stream.setStartedAt(new Date(deployStat.getCtime()));
          stream.setStatus(getDeploymentStatus(id));
View Full Code Here

Examples of org.springframework.xd.dirt.stream.StreamDefinition

      byte[] bytes = zkConnection.getClient().getData().forPath(Paths.build(Paths.STREAMS, id));
      if (bytes == null) {
        return null;
      }
      Map<String, String> map = ZooKeeperUtils.bytesToMap(bytes);
      return new StreamDefinition(id, map.get("definition"));
    }
    catch (Exception e) {
      //NoNodeException - the definition does not exist
      ZooKeeperUtils.wrapAndThrowIgnoring(e, NoNodeException.class);
    }
View Full Code Here

Examples of org.springframework.xd.dirt.stream.StreamDefinition

  @Override
  public List<StreamDefinition> findAll(Iterable<String> ids) {
    List<StreamDefinition> results = new ArrayList<StreamDefinition>();
    for (String id : ids) {
      StreamDefinition sd = this.findOne(id);
      if (sd != null) {
        results.add(sd);
      }
    }
    return results;
View Full Code Here

Examples of org.springframework.xd.dirt.stream.StreamDefinition

    return listValues(pageable, assembler);
  }

  @Override
  protected StreamDefinition createDefinition(String name, String definition) {
    return new StreamDefinition(name, definition);
  }
View Full Code Here

Examples of org.springframework.xd.dirt.stream.StreamDefinition

    integrationSupport.streamDeployer().deleteAll();
  }

  @Test
  public void testValidDeploymentProperties() {
    StreamDefinition testStream = new StreamDefinition("foo", "http | log");
    integrationSupport.streamDeployer().save(testStream);

    Map<String, String> properties = Collections.singletonMap("module.log.count", "3");
    integrationSupport.deployStream(testStream, properties);
  }
View Full Code Here

Examples of org.springframework.xd.dirt.stream.StreamDefinition

    integrationSupport.deployStream(testStream, properties);
  }

  @Test
  public void testValidDeploymentPropertiesUsesLabel() {
    StreamDefinition testStream = new StreamDefinition("foo", "http | bar:log");
    integrationSupport.streamDeployer().save(testStream);

    Map<String, String> properties = Collections.singletonMap("module.bar.count", "3");
    integrationSupport.deployStream(testStream, properties);
  }
View Full Code Here

Examples of org.springframework.xd.dirt.stream.StreamDefinition

    integrationSupport.deployStream(testStream, properties);
  }

  @Test
  public void testInvalidDeploymentProperties() {
    StreamDefinition testStream = new StreamDefinition("foo", "http | log");
    integrationSupport.streamDeployer().save(testStream);

    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage(containsString("module.logo.count"));
View Full Code Here

Examples of org.springframework.xd.dirt.stream.StreamDefinition

    integrationSupport.deployStream(testStream, properties);
  }

  @Test
  public void testInvalidDeploymentPropertiesShouldUseLabel() {
    StreamDefinition testStream = new StreamDefinition("foo", "http | bar: log");
    integrationSupport.streamDeployer().save(testStream);

    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage(containsString("module.log.count"));
View Full Code Here

Examples of org.springframework.xd.dirt.stream.StreamDefinition

    }
  };

  @Test
  public void mqttSourceStreamReceivesMqttSinkStreamOutput() throws Exception {
    StreamDefinition mqtt1 = new StreamDefinition("mqtt1", "queue:mqttsource > mqtt --topic=foo");
    StreamDefinition mqtt2 = new StreamDefinition("mqtt2", "mqtt --topics=foo > queue:mqttsink");
    integrationSupport.createAndDeployStream(mqtt1);
    integrationSupport.createAndDeployStream(mqtt2);

    NamedChannelSource source = new SingleNodeNamedChannelSourceFactory(integrationSupport.messageBus()).createNamedChannelSource("queue:mqttsource");
    NamedChannelSink sink = new SingleNodeNamedChannelSinkFactory(integrationSupport.messageBus()).createNamedChannelSink("queue:mqttsink");
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.