/scdf-app-starter-generator

Project Generator for Spring Cloud Data Flow (SCDF) Application Starters

Primary LanguageJava

Spring Cloud Data Flow Application Starters Project Generator

Usually bootstrapping a fully-fledged Stream App Starter projects requires complying with certain project structure and dependencies and following some code and configuration conventions.

The scdf-app-starter-generator simplifies the bootstrapping task. It uses YAML projects descriptor to define the project’s structure, names, programing models and compulsory dependency versions. Based on the descriptor this tool generates the projects skeleton, complying with the conventions and following the best practices for the selected programming models.

For example lets create a test.yml file whit this content:

app:
  starter:
    outputFolder: ./output

    parentAppName: hello-world
    parentAppVersion: 2.1.0.BUILD-SNAPSHOT

    appStartersBuildVersion: 2.1.0.BUILD-SNAPSHOT

    springCloudBuildVersion: 2.1.2.RELEASE
    springCloudStreamVersion: 2.1.0.RELEASE

    generateTestSupport: true
    generateCommon: true

    apps:
      - appName: hello1
        appType: source
        programmingModel: reactive_stream
        appVersion: 1.0.0.BUILD-SNAPSHOT

      - appName: hello2
        appType: source
        appVersion: 1.0.0.BUILD-SNAPSHOT

      - appName: hello3
        appType: processor
        programmingModel: functional
        appVersion: 1.0.0.BUILD-SNAPSHOT

      - appName: hello4
        appType: sink
        appVersion: 1.0.0.BUILD-SNAPSHOT
Table 1. Table Common properties for all sub-projects part of this app starter umbrella theme:
Property Description

outputFolder

Location where the project source files are written

parentAppName

Name of the application theme common for all applications in this theme

parentAppVersion

Version for the application theme

appStartersBuildVersion

App Starter Build version to use

springCloudBuildVersion

Spring Cloud Dependency version to use.

springCloudStreamVersion

Spring Cloud Stream version to use

generateTestSupport

Generate an app-test-support sub-project

generateCommon

Generate an app-common sub-project

Table 2. Table For every child, app definition the following properties are available:
App Definition Property Description

appName

Location where the project source files are written

appVersion

application version

appType

source, processor or sink

programmingModel

Depending on the app type one of the following styles is generated: default_model, functional, reactive, reactive_stream

Runt the generator against the test.yml:

java -jar ./scdf-app-starter-generator-0.0.1-SNAPSHOT.jar --spring.config.location=./test.yml

Will generate an app starters projects skeleton that looks like this:

300

Go inside the hello-world and generate the app starters:

mvn clean install -Pspring -PgenerateApps

Above will create an apps folder with generated apps starters

Programming Model support:

Tool supports several programming models for the generated application starter projects. Use the programmingModel property to configure one of the following options:

Table 3. Table Programming Models per Application Type
Application Type Programming Models

source

default_model, functional, reactive, reactive_stream

processor

default_model, functional, reactive

sink

default_model, functional, reactive

Not setting the programmingModel defaults to the default_model.