![]() |
玩足球的杯子 · Data Factory Data ...· 1 月前 · |
![]() |
坚韧的开心果 · ABAQUS ...· 5 月前 · |
![]() |
聪明的炒饭 · Java-快速读取百万级数据文件,插入数据库 ...· 1 年前 · |
![]() |
不爱学习的火车 · setInterval和setTimeout ...· 1 年前 · |
SPRING_APPLICATION_JSON
spring-cloud-dataflow
src/local/download-apps.sh
src/local/create-containers.sh
spring-cloud-skipper
local/download-app.sh
local/create-container.sh
stream-applications
local/download-apps.sh
local/create-containers.sh
local/pack-containers.sh
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and print or electronically.
Ask a question. We monitor
stackoverflow.com
for questions
tagged with
spring-cloud-dataflow
.
Report bugs with Spring Cloud Data Flow at github.com/spring-cloud/spring-cloud-dataflow/issues .
All of Spring Cloud Data Flow is open source, including the documentation! If you find problems with the docs or if you just want to improve them, please get involved .Spring Cloud Data Flow provides tools to create complex topologies for streaming and batch data pipelines. The data pipelines consist of Spring Boot apps, built using the Spring Cloud Stream or Spring Cloud Task microservice frameworks.
Spring Cloud Data Flow supports a range of data processing use cases, from ETL to import/export, event streaming, and predictive analytics.
This section covers how to get started with Spring Cloud Data Flow running locally on Docker Compose. See the Local Machine section of the microsite for more information on installing Spring Cloud Data Flow on Docker Compose.
Once you have the Data Flow server installed locally, you probably want to get started with orchestrating the deployment of readily available pre-built applications into coherent streaming or batch data pipelines. We have guides to help you get started with both Stream and Batch processing.
This section covers how to get started with Spring Cloud Data Flow on Cloud Foundry. See the Cloud Foundry section of the microsite for more information on installing Spring Cloud Data Flow on Cloud Foundry.
Once you have the Data Flow server installed on Cloud Foundry, you probably want to get started with orchestrating the deployment of readily available pre-built applications into coherent streaming or batch data pipelines. We have guides to help you get started with both Stream and Batch processing.
This section covers how to get started with Spring Cloud Data Flow running locally on Kubernetes. See Configuration - Kubernetes for more information on installing Spring Cloud Data Flow on Kubernetes.
Once you have the Data Flow server installed on Kubernetes, you probably want to get started with orchestrating the deployment of readily available pre-built applications into a coherent streaming or batch data pipelines. We have guides to help you get started with both Stream and Batch processing.
We have prepared scripts to simplify the process of creating a local Minikube or Kind cluster, or to use a remote cluster like GKE or TKG, more at Configure Kubernetes for Local Development
A selection of pre-built applications for various data integration and processing scenarios to facilitate learning and experimentation can be found here .
Spring Cloud Data Flow simplifies the development and deployment of applications that are focused on data-processing use cases.
The Architecture section of the microsite describes Data Flow’s architecture.
Spring Cloud Dataflow supports referencing artifacts via Maven (
maven:
).
If you want to override specific Maven configuration properties (remote repositories, proxies, and others) or run the Data Flow Server behind a proxy,
you need to specify those properties as command-line arguments when you start the Data Flow Server, as shown in the following example:
By default, the protocol is set to
http
. You can omit the auth properties if the proxy does not need a username and password. Also, by default, the maven
localRepository
is set to
${user.home}/.m2/repository/
.
As shown in the preceding example, you can specify the remote repositories along with their authentication (if needed). If the remote repositories are behind a proxy, you can specify the proxy properties, as shown in the preceding example.
You can specify the repository policies for each remote repository configuration, as shown in the preceding example.
The key
policy
is applicable to both the
snapshot
and the
release
repository policies.
See the Repository Policies topic for the list of supported repository policies.
As these are Spring Boot
@ConfigurationProperties
you need to specify by adding them to the
SPRING_APPLICATION_JSON
environment variable. The following example shows how the JSON is structured:
There is a limited support for using
Wagon
transport with Maven. Currently, this
exists to support
preemptive
authentication with
http
-based repositories
and needs to be enabled manually.
Wagon-based
http
transport is enabled by setting the
maven.use-wagon
property
to
true
. Then you can enable
preemptive
authentication for each remote
repository. Configuration loosely follows the similar patterns found in
HttpClient HTTP Wagon
.
At the time of this writing, documentation in Maven’s own site is slightly misleading
and missing most of the possible configuration options.
The
maven.remote-repositories.<repo>.wagon.http
namespace contains all Wagon
http
related settings, and the keys directly under it map to supported
http
methods — namely,
all
,
put
,
get
and
head
, as in Maven’s own configuration.
Under these method configurations, you can then set various options, such as
use-preemptive
. A simpl
preemptive
configuration to send an auth
header with all requests to a specified remote repository would look like the following example:
There are settings for
use-default-headers
,
connection-timeout
,
read-timeout
, request
headers
, and HttpClient
params
. For more about parameters,
see
Wagon ConfigurationUtils
.
By default, the Data Flow server is unsecured and runs on an unencrypted HTTP connection. You can secure your REST endpoints as well as the Data Flow Dashboard by enabling HTTPS and requiring clients to authenticate with OAuth 2.0 .
While you can theoretically choose any OAuth provider in conjunction with Spring Cloud Data Flow, we recommend using the CloudFoundry User Account and Authentication (UAA) Server .
Not only is the UAA OpenID certified and is used by Cloud Foundry, but you can also use it in local stand-alone deployment scenarios. Furthermore, the UAA not only provides its own user store, but it also provides comprehensive LDAP integration.
By default, the dashboard, management, and health endpoints use HTTP as a transport.
You can switch to HTTPS by adding a certificate to your configuration in
application.yml
, as shown in the following example:
9393
, you may choose to change the port to a more common HTTPs-typical port.
The alias (or name) under which the key is stored in the keystore.
The path to the keystore file. You can also specify classpath resources, by using the classpath prefix - for example:
classpath:path/to/keystore
.
The password of the keystore.
The password of the key.
The path to the truststore file. You can also specify classpath resources, by using the classpath prefix - for example:
classpath:path/to/trust-store
The password of the trust store.
If HTTPS is enabled, it completely replaces HTTP as the protocol over
which the REST endpoints and the Data Flow Dashboard interact. Plain HTTP requests
fail. Therefore, make sure that you configure your Shell accordingly.
For testing purposes or during development, it might be convenient to create self-signed certificates. To get started, execute the following command to create a certificate:
$ keytool -genkey -alias dataflow -keyalg RSA -keystore dataflow.keystore \
-validity 3650 -storetype JKS \
-dname "CN=localhost, OU=Spring, O=Pivotal, L=Kailua-Kona, ST=HI, C=US" (1)
-keypass dataflow -storepass dataflow
key-store: "/your/path/to/dataflow.keystore"
key-store-type: jks
key-store-password: dataflow
key-password: dataflow
This is all you need to do for the Data Flow Server. Once you start the server,
you should be able to access it at
localhost:8443/
.
As this is a self-signed certificate, you should hit a warning in your browser, which
you need to ignore.
By default, self-signed certificates are an issue for the shell, and additional steps are necessary to make the shell work with self-signed certificates. Two options are available:
In order to use the JVM truststore option, you need to export the previously created certificate from the keystore, as follows:
$ java -Djavax.net.ssl.trustStorePassword=dataflow \
-Djavax.net.ssl.trustStore=/path/to/dataflow.truststore \
-Djavax.net.ssl.trustStoreType=jks \
-jar spring-cloud-dataflow-shell-2.11.0.jar
Alternatively, you can also bypass the certification validation by providing the
optional
--dataflow.skip-ssl-validation=true
command-line parameter.
If you set this command-line parameter, the shell accepts any (self-signed) SSL certificate.
To support authentication and authorization, Spring Cloud Data Flow uses OAuth 2.0 . It lets you integrate Spring Cloud Data Flow into Single Sign On (SSO) environments.
Authorization Code : Used for the GUI (browser) integration. Visitors are redirected to your OAuth Service for authentication
Password : Used by the shell (and the REST integration), so visitors can log in with username and password
Client Credentials : Retrieves an access token directly from your OAuth provider and passes it to the Data Flow server by using the Authorization HTTP header
Basic authentication , which uses the Password Grant Type to authenticate with your OAuth2 service
Access token , which uses the Client Credentials Grant Type
You can turn on OAuth2 authentication by adding the following to
application.yml
or by setting
environment variables. The following example shows the minimal setup needed for
CloudFoundry User Account and Authentication (UAA) Server
:
openid
scope.
If your provider also provides additional scopes to control the role assignments,
you must specify those scopes here as well.
OpenID endpoint. Used to retrieve user information such as the username. Mandatory.
The JSON property of the response that contains the username.
Used to introspect and validate a directly passed-in token. Mandatory.
When you access the Root URL with a web browser and
security enabled, you are redirected to the Dashboard UI. To see the
list of REST endpoints, specify the
application/json
Accept
header. Also be sure
to add the
Accept
header by using tools such as
Postman
(Chrome)
or
RESTClient
(Firefox).
Besides Basic Authentication, you can also provide an access token, to access the REST API. To do so, retrieve an OAuth2 Access Token from your OAuth2 provider and pass that access token to the REST Api by using the Authorization HTTP header, as follows:
$ curl -H "Authorization: Bearer <ACCESS_TOKEN>" http://localhost:9393/ -H 'Accept: application/json'
The preceding content mostly deals with authentication — that is, how to assess the identity of the user. In this section, we discuss the available authorization options — that is, who can do what.
The authorization rules are defined in
dataflow-server-defaults.yml
(part of
the Spring Cloud Data Flow Core module).
Because the determination of security roles is environment-specific,
Spring Cloud Data Flow, by default, assigns all roles to authenticated OAuth2
users. The
DefaultDataflowAuthoritiesExtractor
class is used for that purpose.
Alternatively, you can have Spring Cloud Data Flow map OAuth2 scopes to Data Flow roles by
setting the boolean property
map-oauth-scopes
for your provider to
true
(the default is
false
).
For example, if your provider’s ID is
uaa
, the property would be
spring.cloud.dataflow.security.authorization.provider-role-mappings.uaa.map-oauth-scopes
.
By default all roles are assigned to users that login to Spring Cloud Data Flow. However, you can set the property:
spring.cloud.dataflow.security.authorization.provider-role-mappings.uaa.map-oauth-scopes: true
This will instruct the underlying
DefaultAuthoritiesExtractor
to map
OAuth scopes to the respective authorities. The following scopes are supported:
Mapping roles from scopes has its own problems as it may not be always possible to change those in a given identity provider. If it’s possible to define group claims in a token returned from an identity provider, these can be used as well to map into server roles.
You can also customize the role-mapping behavior by providing your own Spring bean definition that
extends Spring Cloud Data Flow’s
AuthorityMapper
interface. In that case,
the custom bean definition takes precedence over the default one provided by
Spring Cloud Data Flow.
The default scheme uses seven roles to protect the REST endpoints that Spring Cloud Data Flow exposes:
As mentioned earlier in this section, all authorization-related default settings are specified
in
dataflow-server-defaults.yml
, which is part of the Spring Cloud Data Flow Core
Module. Nonetheless, you can override those settings, if desired — for example,
in
application.yml
. The configuration takes the form of a YAML list (as some
rules may have precedence over others). Consequently, you need to copy and paste
the whole list and tailor it to your needs (as there is no way to merge lists).
When security is enabled, the dashboard and the shell are role-aware, meaning that, depending on the assigned roles, not all functionality may be visible.
For instance, shell commands for which the user does not have the necessary roles are marked as unavailable.
When security is enabled, the
Spring Boot HTTP Management Endpoints
are secured in the same way as the other REST endpoints. The management REST endpoints
are available under
/management
and require the
MANAGEMENT
role.
The default configuration in
dataflow-server-defaults.yml
is as follows:
For local deployment scenarios, we recommend using the CloudFoundry User Account and Authentication (UAA) Server , which is OpenID certified . While the UAA is used by Cloud Foundry , it is also a fully featured stand alone OAuth2 server with enterprise features, such as LDAP integration .
You need to check out, build and run UAA. To do so, make sure that you:
As the UAA is an OpenID provider and uses JSON Web Tokens (JWT), it needs to have a private key for signing those JWTs:
openssl genrsa -out signingkey.pem 2048
openssl rsa -in signingkey.pem -pubout -out verificationkey.pem
export JWT_TOKEN_SIGNING_KEY=$(cat signingkey.pem)
export JWT_TOKEN_VERIFICATION_KEY=$(cat verificationkey.pem)
The configuration of the UAA is driven by a YAML file
uaa.yml
, or you can script the configuration
using the UAA Command Line Client:
uaac target http://uaa:8080/uaa
uaac token client get admin -s adminsecret
uaac client add dataflow \
--name dataflow \
--secret dataflow \
--scope cloud_controller.read,cloud_controller.write,openid,password.write,scim.userids,sample.create,sample.view,dataflow.create,dataflow.deploy,dataflow.destroy,dataflow.manage,dataflow.modify,dataflow.schedule,dataflow.view \
--authorized_grant_types password,authorization_code,client_credentials,refresh_token \
--authorities uaa.resource,dataflow.create,dataflow.deploy,dataflow.destroy,dataflow.manage,dataflow.modify,dataflow.schedule,dataflow.view,sample.view,sample.create\
--redirect_uri http://localhost:9393/login \
--autoapprove openid
uaac group add "sample.view"
uaac group add "sample.create"
uaac group add "dataflow.view"
uaac group add "dataflow.create"
uaac user add springrocks -p mysecret --emails [email protected]
uaac user add vieweronly -p mysecret --emails [email protected]
uaac member add "sample.view" springrocks
uaac member add "sample.create" springrocks
uaac member add "dataflow.view" springrocks
uaac member add "dataflow.create" springrocks
uaac member add "sample.view" vieweronly
* TCP_NODELAY set
* Connected to uaa (127.0.0.1) port 8080 (#0)
* Server auth using Basic with user 'dataflow'
> POST /uaa/oauth/token HTTP/1.1
> Host: uaa:8080
> Authorization: Basic ZGF0YWZsb3c6ZGF0YWZsb3c=
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Length: 97
> Content-Type: application/x-www-form-urlencoded
* upload completely sent off: 97 out of 97 bytes
< HTTP/1.1 200
< Cache-Control: no-store
< Pragma: no-cache
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< Content-Type: application/json;charset=UTF-8
< Transfer-Encoding: chunked
< Date: Thu, 31 Oct 2019 21:22:59 GMT
* Connection #0 to host uaa left intact
{"access_token":"0329c8ecdf594ee78c271e022138be9d","token_type":"bearer","id_token":"eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHBzOi8vbG9jYWxob3N0OjgwODAvdWFhL3Rva2VuX2tleXMiLCJraWQiOiJsZWdhY3ktdG9rZW4ta2V5IiwidHlwIjoiSldUIn0.eyJzdWIiOiJlZTg4MDg4Ny00MWM2LTRkMWQtYjcyZC1hOTQ4MmFmNGViYTQiLCJhdWQiOlsiZGF0YWZsb3ciXSwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDkwL3VhYS9vYXV0aC90b2tlbiIsImV4cCI6MTU3MjYwMDE3OSwiaWF0IjoxNTcyNTU2OTc5LCJhbXIiOlsicHdkIl0sImF6cCI6ImRhdGFmbG93Iiwic2NvcGUiOlsib3BlbmlkIl0sImVtYWlsIjoic3ByaW5ncm9ja3NAc29tZXBsYWNlLmNvbSIsInppZCI6InVhYSIsIm9yaWdpbiI6InVhYSIsImp0aSI6IjAzMjljOGVjZGY1OTRlZTc4YzI3MWUwMjIxMzhiZTlkIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImNsaWVudF9pZCI6ImRhdGFmbG93IiwiY2lkIjoiZGF0YWZsb3ciLCJncmFudF90eXBlIjoicGFzc3dvcmQiLCJ1c2VyX25hbWUiOiJzcHJpbmdyb2NrcyIsInJldl9zaWciOiJlOTkyMDQxNSIsInVzZXJfaWQiOiJlZTg4MDg4Ny00MWM2LTRkMWQtYjcyZC1hOTQ4MmFmNGViYTQiLCJhdXRoX3RpbWUiOjE1NzI1NTY5Nzl9.bqYvicyCPB5cIIu_2HEe5_c7nSGXKw7B8-reTvyYjOQ2qXSMq7gzS4LCCQ-CMcb4IirlDaFlQtZJSDE-_UsM33-ThmtFdx--TujvTR1u2nzot4Pq5A_ThmhhcCB21x6-RNNAJl9X9uUcT3gKfKVs3gjE0tm2K1vZfOkiGhjseIbwht2vBx0MnHteJpVW6U0pyCWG_tpBjrNBSj9yLoQZcqrtxYrWvPHaa9ljxfvaIsOnCZBGT7I552O1VRHWMj1lwNmRNZy5koJFPF7SbhiTM8eLkZVNdR3GEiofpzLCfoQXrr52YbiqjkYT94t3wz5C6u1JtBtgc2vq60HmR45bvg","refresh_token":"6ee95d017ada408697f2d19b04f7aa6c-r","expires_in":43199,"scope":"scim.userids openid sample.create cloud_controller.read password.write cloud_controller.write sample.view","jti":"0329c8ecdf594ee78c271e022138be9d"}
By default, stream (requires Skipper), and tasks are enabled and Task Scheduler is disabled by default.
The REST
/about
endpoint provides information on the features that have been enabled and disabled.
A relational database is used to store stream and task definitions as well as the state of executed tasks. Spring Cloud Data Flow provides schemas for MariaDB , MySQL , Oracle , PostgreSQL , Db2 , SQL Server , and H2 . The schema is automatically created when the server starts.
MySQL 5.7
jdbc:mysql://${db-hostname}:${db-port}/${db-name}?permitMysqlScheme
org.mariadb.jdbc.Driver
MySQL 8.0+
jdbc:mysql://${db-hostname}:${db-port}/${db-name}?allowPublicKeyRetrieval=true&useSSL=false&autoReconnect=true&permitMysqlScheme [ 1 ]
org.mariadb.jdbc.Driver
PostgresSQL
jdbc:postgres://${db-hostname}:${db-port}/${db-name}
org.postgresql.Driver
SQL Server
jdbc:sqlserver://${db-hostname}:${db-port};databasename=${db-name}&encrypt=false
com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc:db2://${db-hostname}:${db-port}/{db-name}
com.ibm.db2.jcc.DB2Driver
Oracle
jdbc:oracle:thin:@${db-hostname}:${db-port}/{db-name}
oracle.jdbc.OracleDriver
java -jar spring-cloud-dataflow-server/target/spring-cloud-dataflow-server-2.11.0.jar \
--spring.datasource.url=jdbc:mariadb://localhost:3306/mydb \
--spring.datasource.username=user \
--spring.datasource.password=pass \
--spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
Likewise, to start the server with MariaDB using environment variables execute the following command:
SPRING_DATASOURCE_URL=jdbc:mariadb://localhost:3306/mydb
SPRING_DATASOURCE_USERNAME=user
SPRING_DATASOURCE_PASSWORD=pass
SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.mariadb.jdbc.Driver
java -jar spring-cloud-dataflow-server/target/spring-cloud-dataflow-server-2.11.0.jar
To add a custom driver for the database (for example, Oracle), you should rebuild the Data Flow Server and add the dependency to the Maven
pom.xml
file.
You need to modify the maven
pom.xml
of
spring-cloud-dataflow-server
module.
There are GA release tags in GitHub repository, so you can switch to desired GA tags to add the drivers on the production-ready codebase.
To add a custom JDBC driver dependency for the Spring Cloud Data Flow server:
Select the tag that corresponds to the version of the server you want to rebuild and clone the github repository.
Edit the spring-cloud-dataflow-server/pom.xml and, in the
dependencies
section, add the dependency for the database driver required. In the following example , an Oracle driver has been chosen:
You can also provide default values when rebuilding the server by adding the necessary properties to the dataflow-server.yml file, as shown in the following example for PostgreSQL:
spring:
datasource:
url: jdbc:postgresql://localhost:5432/mydb
username: myuser
password: mypass
driver-class-name:org.postgresql.Driver
On default database schema is managed with Flyway which is convenient if it’s possible to give enough permissions to a database user.
Here’s a description what happens when Skipper server is started:
Does a baseline(to version 1) if schema is not empty as Dataflow tables may be in place if a shared DB is used.
If schema is empty, flyway assumes to start from a scratch.
Goes through all needed schema migrations.
Does a baseline(to version 1) if schema is not empty as Skipper tables may be in place if a shared DB is used.
If schema is empty, flyway assumes to start from a scratch.
Goes through all needed schema migrations.
We have schema ddl’s in our source code
schemas
which can be used manually if
Flyway
is disabled by using configuration
spring.flyway.enabled=false
. This is a good option if company’s databases
are restricted and i.e. applications itself cannot create schemas.
You can use the following configuration properties of the
Local deployer
to customize how Streams and Tasks are deployed.
When deploying using the Data Flow shell, you can use the syntax
deployer.<appName>.local.<deployerPropertyName>
. See below for an example shell usage.
These properties are also used when configuring
Local Task Platforms
in the Data Flow server and local platforms in Skipper for deploying Streams.
workingDirectoriesRoot
Directory in which all created processes will run and create log files.
java.io.tmpdir
envVarsToInherit
Array of regular expression patterns for environment variables that are passed to launched applications.
<"TMP", "LANG", "LANGUAGE", "LC_.*", "PATH", "SPRING_APPLICATION_JSON"> on windows and <"TMP", "LANG", "LANGUAGE", "LC_.*", "PATH"> on Unix
deleteFilesOnExit
Whether to delete created files and directories on JVM exit.
javaCmd
Command to run java
shutdownTimeout
Max number of seconds to wait for app shutdown.
javaOpts
The Java Options to pass to the JVM, e.g -Dtest=foo
inheritLogging
allow logging to be redirected to the output stream of the process that triggered child process.
false
debugPort
Port for remote debugging
At deployment time, if you specify an
-Xmx
option in the
deployer.<app>.local.javaOpts
property in addition to a value of the
deployer.<app>.local.memory
option, the value in the
javaOpts
property has precedence. Also, the
javaOpts
property set when deploying the application has precedence over the Data Flow Server’s
spring.cloud.deployer.local.javaOpts
property.
Spring Cloud Data Flow
local
server is automatically configured to use
RollingFileAppender
for logging.
The logging configuration is located on the classpath contained in a file named
logback-spring.xml
.
By default, the log file is configured to use:
<property name="LOG_FILE" value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/spring-cloud-dataflow-server-local.log}"/>
with the logback configuration for the
RollingPolicy
:
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${LOG_FILE}</file> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <!-- daily rolling --> <fileNamePattern>${LOG_FILE}.${LOG_FILE_ROLLING_FILE_NAME_PATTERN:-%d{yyyy-MM-dd}}.%i.gz</fileNamePattern> <maxFileSize>${LOG_FILE_MAX_SIZE:-100MB}</maxFileSize> <maxHistory>${LOG_FILE_MAX_HISTORY:-30}</maxHistory> <totalSizeCap>${LOG_FILE_TOTAL_SIZE_CAP:-500MB}</totalSizeCap> </rollingPolicy> <encoder> <pattern>${FILE_LOG_PATTERN}</pattern> </encoder> </appender>
To check the
java.io.tmpdir
for the current Spring Cloud Data Flow Server
local
server,
jinfo <pid> | grep "java.io.tmpdir"
If you want to change or override any of the properties
LOG_FILE
,
LOG_PATH
,
LOG_TEMP
,
LOG_FILE_MAX_SIZE
,
LOG_FILE_MAX_HISTORY
and
LOG_FILE_TOTAL_SIZE_CAP
, please set them as system properties.
Data Flow Server delegates to the Skipper server the management of the Stream’s lifecycle. Set the configuration property
spring.cloud.skipper.client.serverUri
to the location of Skipper, e.g.
$ java -jar spring-cloud-dataflow-server-2.11.0.jar --spring.cloud.skipper.client.serverUri=https://192.51.100.1:7577/api
The configuration of how streams are deployed and to which platforms, is done by configuration of
platform accounts
on the Skipper server.
See the documentation on
platforms
for more information.
The Data Flow server is responsible for deploying Tasks.
Tasks that are launched by Data Flow write their state to the same database that is used by the Data Flow server.
For Tasks which are Spring Batch Jobs, the job and step execution data is also stored in this database.
As with streams launched by Skipper, Tasks can be launched to multiple platforms.
If no platform is defined, a platform named
default
is created using the default values of the class
LocalDeployerProperties
, which is summarized in the table
Local Deployer Properties
To configure new platform accounts for the local platform, provide an entry under the
spring.cloud.dataflow.task.platform.local
section in your
application.yaml
file or via another Spring Boot supported mechanism.
In the following example, two local platform accounts named
localDev
and
localDevDebug
are created.
The keys such as
shutdownTimeout
and
javaOpts
are local deployer properties.
spring:
cloud:
dataflow:
task:
platform:
local:
accounts:
localDev:
shutdownTimeout: 60
javaOpts: "-Dtest=foo -Xmx1024m"
localDevDebug:
javaOpts: "-Xdebug -Xmx2048m"
You can configure the Data Flow server that is running locally to deploy tasks to Cloud Foundry or Kubernetes. See the sections on Cloud Foundry Task Platform Configuration and Kubernetes Task Platform Configuration for more information.
Detailed examples for launching and scheduling tasks across multiple platforms, are available in this section Multiple Platform Support for Tasks on dataflow.spring.io .
See the CloudFoundry User Account and Authentication (UAA) Server configuration section for details how to configure for local testing and development.
LDAP Authentication (Lightweight Directory Access Protocol) is indirectly provided by Spring Cloud Data Flow using the UAA. The UAA itself provides comprehensive LDAP support .
While you may use your own OAuth2 authentication server, the LDAP support documented here requires using the UAA as authentication server. For any other provider, please consult the documentation for that particular provider.
When integrating with an external identity provider such as LDAP, authentication within the UAA becomes chained . UAA first attempts to authenticate with a user’s credentials against the UAA user store before the external provider, LDAP. For more information, see Chained Authentication in the User Account and Authentication LDAP Integration GitHub documentation.
The OAuth2 authentication server (UAA), provides comprehensive support for mapping LDAP groups to OAuth scopes .
The following options exist:
ldap/ldap-groups-as-scopes.xml
Group names will be retrieved from an LDAP attribute. E.g.
CN
ldap/ldap-groups-map-to-scopes.xml
Groups will be mapped to UAA groups using the external_group_mapping table
These values are specified via the configuration property
ldap.groups.file controls
. Under the covers
these values reference a Spring XML configuration file.
During test and development it might be necessary to make frequent changes to LDAP groups and users and see those reflected in the UAA. However, user information is cached for the duration of the login. The following script helps to retrieve the updated information quickly:
#!/bin/bash
uaac token delete --all
uaac target http://localhost:8080/uaa
uaac token owner get cf <username> -s "" -p <password>
uaac token client get admin -s adminsecret
uaac user get <username>
For local testing and development, you may also use the Resource and Authorization Server support provided by Spring Security . It allows you to easily create your own OAuth2 Server by configuring the SecurityFilterChain.
Samples can be found at: Spring Security Samples
When using the Shell, the credentials can either be provided via username and password or by specifying a credentials-provider command. If your OAuth2 provider supports the Password Grant Type you can start the Data Flow Shell with:
$ java -jar spring-cloud-dataflow-shell-2.11.0.jar \
--dataflow.uri=http://localhost:9393 \ (1)
--dataflow.username=my_username \ (2)
--dataflow.password=my_password \ (3)
--skip-ssl-validation \ (4)
Keep in mind that when authentication for Spring Cloud Data Flow is enabled,
the underlying OAuth2 provider
must
support the
Password
OAuth2 Grant Type
if you want to use the Shell via username/password authentication.
server-unknown:>dataflow config server \
--uri http://localhost:9393 \ (1)
--username myuser \ (2)
--password mysecret \ (3)
--skip-ssl-validation \ (4)
╔═══════════╤═══════════════════════════════════════╗
║Credentials│[username='my_username, password=****']║
╠═══════════╪═══════════════════════════════════════╣
║Result │ ║
║Target │http://localhost:9393 ║
╚═══════════╧═══════════════════════════════════════╝
Alternatively, you can specify the
credentials-provider
command in order to
pass-in a bearer token directly, instead of providing a username and password.
This works from within the shell or by providing the
--dataflow.credentials-provider-command
command-line argument when starting the Shell.
When using the credentials-provider command, please be aware that your specified command must return a Bearer token (Access Token prefixed with Bearer ). For instance, in Unix environments the following simplistic command can be used:
$ java -jar spring-cloud-dataflow-shell-2.11.0.jar \
--dataflow.uri=http://localhost:9393 \
--dataflow.credentials-provider-command="echo Bearer 123456789"
The Spring Cloud Data Flow About Restful API result contains a display name, version, and, if specified, a URL for each of the major dependencies that comprise Spring Cloud Data Flow. The result (if enabled) also contains the sha1 and or sha256 checksum values for the shell dependency. The information that is returned for each of the dependencies is configurable by setting the following properties:
spring.cloud.dataflow.version-info.spring-cloud-dataflow-core.name
Name to be used for the core
spring.cloud.dataflow.version-info.spring-cloud-dataflow-core.version
Version to be used for the core
spring.cloud.dataflow.version-info.spring-cloud-dataflow-dashboard.name
Name to be used for the dashboard
spring.cloud.dataflow.version-info.spring-cloud-dataflow-dashboard.version
Version to be used for the dashboard
spring.cloud.dataflow.version-info.spring-cloud-dataflow-implementation.name
Name to be used for the implementation
spring.cloud.dataflow.version-info.spring-cloud-dataflow-implementation.version
Version to be used for the implementation
spring.cloud.dataflow.version-info.spring-cloud-dataflow-shell.name
Name to be used for the shell
spring.cloud.dataflow.version-info.spring-cloud-dataflow-shell.version
Version to be used for the shell
spring.cloud.dataflow.version-info.spring-cloud-dataflow-shell.url
URL to be used for downloading the shell dependency
spring.cloud.dataflow.version-info.spring-cloud-dataflow-shell.checksum-sha1
Sha1 checksum value that is returned with the shell dependency info
spring.cloud.dataflow.version-info.spring-cloud-dataflow-shell.checksum-sha256
Sha256 checksum value that is returned with the shell dependency info
spring.cloud.dataflow.version-info.spring-cloud-dataflow-shell.checksum-sha1-url
if
spring.cloud.dataflow.version-info.spring-cloud-dataflow-shell.checksum-sha1
is not specified, SCDF uses the contents of the file specified at this URL for the checksum
spring.cloud.dataflow.version-info.spring-cloud-dataflow-shell.checksum-sha256-url
if the
spring.cloud.dataflow.version-info.spring-cloud-dataflow-shell.checksum-sha256
is not specified, SCDF uses the contents of the file specified at this URL for the checksum
By default, checksum values are not displayed for the shell dependency. If
you need this feature enabled, set the
spring.cloud.dataflow.version-info.dependency-fetch.enabled
property to true.
There are reserved values (surrounded by curly braces) that you can insert into the URL that will make sure that the links are up to date:
repository
: if using a build-snapshot, milestone, or release candidate of
Data Flow, the repository refers to the repo-spring-io repository. Otherwise, it
refers to Maven Central.
version
: Inserts the version of the jar/pom.
This section describes how to configure Spring Cloud Data Flow server’s features, such as security and which relational database to use. It also describes how to configure Spring Cloud Data Flow shell’s features.
Data Flow server offers a specific set of features that you can enable or disable when launching. These features include all the lifecycle operations and REST endpoints (server, client implementations including Shell and the UI) for:
You can use the following configuration properties of the Data Flow server’s
Cloud Foundry deployer
to customize how applications are deployed.
When deploying with the Data Flow shell, you can use the syntax
deployer.<appName>.cloudfoundry.<deployerPropertyName>
. See below for an example shell usage.
These properties are also used when configuring the
Cloud Foundry Task platforms
in the Data Flow server and and Kubernetes platforms in Skipper for deploying Streams.
routes
The list of routes that the application should be bound to. Mutually exclusive with host and domain.
buildpack
The buildpack to use for deploying the application. Deprecated use buildpacks.
github.com/cloudfoundry/java-buildpack.git#v4.29.1
buildpacks
The list of buildpacks to use for deploying the application.
github.com/cloudfoundry/java-buildpack.git#v4.29.1
memory
The amount of memory to allocate. Default unit is mebibytes, 'M' and 'G" suffixes supported
1024m
The amount of disk space to allocate. Default unit is mebibytes, 'M' and 'G" suffixes supported.
1024m
healthCheck
The type of health check to perform on deployed application. Values can be HTTP, NONE, PROCESS, and PORT
healthCheckHttpEndpoint
The path that the http health check will use,
/health
healthCheckTimeout
The timeout value for health checks in seconds.
instances
The number of instances to run.
enableRandomAppNamePrefix
Flag to enable prefixing the app name with a random prefix.
apiTimeout
Timeout for blocking API calls, in seconds.
statusTimeout
Timeout for status API operations in milliseconds
useSpringApplicationJson
Flag to indicate whether application properties are fed into
SPRING_APPLICATION_JSON
or as separate environment variables.
stagingTimeout
Timeout allocated for staging the application.
15 minutes
startupTimeout
Timeout allocated for starting the application.
5 minutes
appNamePrefix
String to use as prefix for name of deployed application
The Spring Boot property
spring.application.name
of the application that is using the deployer library.
deleteRoutes
Whether to also delete routes when un-deploying an application.
javaOpts
The Java Options to pass to the JVM, e.g -Dtest=foo
pushTasksEnabled
Whether to push task applications or assume that the application already exists when launched.
autoDeleteMavenArtifacts
Whether to automatically delete Maven artifacts from the local repository when deployed.
env.<key>
Defines a top level environment variable. This is useful for customizing
Java build pack configuration
which must be included as top level environment variables in the application manifest, as the Java build pack does not recognize
SPRING_APPLICATION_JSON
.
The deployer determines if the app has Java CfEnv in its classpath. If so, it applies the required configuration .
You can set the buildpack that is used to deploy each application. For example, to use the Java offline buildback, set the following environment variable:
Setting
buildpack
is now deprecated in favour of
buildpacks
which allows you to pass on more than one if needed. More about this can be found from
How Buildpacks Work
.
You can customize the health check mechanism used by Cloud Foundry to assert whether apps are running by using the
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_HEALTH_CHECK
environment variable. The current supported options
are
http
(the default),
port
, and
none
.
You can also set environment variables that specify the HTTP-based health check endpoint and timeout:
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_HEALTH_CHECK_ENDPOINT
and
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_HEALTH_CHECK_TIMEOUT
, respectively. These default to
/health
(the Spring Boot default location) and
120
seconds.
dataflow:> stream create --name postgresstream --definition "http | jdbc --tableName=names --columns=name"
dataflow:> stream deploy --name postgresstream --properties "deployer.http.memory=512, deployer.jdbc.cloudfoundry.services=postgres"
You can configure these settings separately for stream and task apps. To alter settings for tasks,
substitute
TASK
for
STREAM
in the property name, as the following example shows:
cf set-env dataflow-server SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_MEMORY 512
The Data Flow server is responsible for deploying Tasks.
Tasks that are launched by Data Flow write their state to the same database that is used by the Data Flow server.
For Tasks which are Spring Batch Jobs, the job and step execution data is also stored in this database.
As with Skipper, Tasks can be launched to multiple platforms.
When Data Flow is running on Cloud Foundry, a Task platfom must be defined.
To configure new platform accounts that target Cloud Foundry, provide an entry under the
spring.cloud.dataflow.task.platform.cloudfoundry
section in your
application.yaml
file for via another Spring Boot supported mechanism.
In the following example, two Cloud Foundry platform accounts named
dev
and
qa
are created.
The keys such as
memory
and
disk
are
Cloud Foundry Deployer Properties
.
spring:
cloud:
dataflow:
task:
platform:
cloudfoundry:
accounts:
connection:
url: https://api.run.pivotal.io
org: myOrg
space: mySpace
domain: cfapps.io
username: [email protected]
password: drowssap
skipSslValidation: false
deployment:
memory: 512m
disk: 2048m
instances: 4
services: rabbit,postgres
appNamePrefix: dev1
connection:
url: https://api.run.pivotal.io
org: myOrgQA
space: mySpaceQA
domain: cfapps.io
username: [email protected]
password: drowssap
skipSslValidation: true
deployment:
memory: 756m
disk: 724m
instances: 2
services: rabbitQA,postgresQA
appNamePrefix: qa1
You can configure the Data Flow server that is on Cloud Foundry to deploy tasks to Cloud Foundry or Kubernetes. See the section on Kubernetes Task Platform Configuration for more information.
Detailed examples for launching and scheduling tasks across multiple platforms, are available in this section Multiple Platform Support for Tasks on dataflow.spring.io .
To help avoid clashes with routes across spaces in Cloud Foundry, a naming strategy that provides a random prefix to a
deployed application is available and is enabled by default. You can override the
default configurations
and set the respective properties by using
cf set-env
commands.
For instance, if you want to disable the randomization, you can override it by using the following command:
cf set-env dataflow-server SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_ENABLE_RANDOM_APP_NAME_PREFIX false
As an alternative to a random name or to get even more control over the hostname used by the deployed apps, you can use custom deployment properties, as the following example shows:
dataflow:>stream create foo --definition "http | log"
sdataflow:>stream deploy foo --properties "deployer.http.cloudfoundry.domain=mydomain.com,
deployer.http.cloudfoundry.host=myhost,
deployer.http.cloudfoundry.route-path=my-path"
The preceding example binds the
http
app to the
myhost.mydomain.com/my-path
URL. Note that this
example shows
all
of the available customization options. In practice, you can use only one or two out of the three.
Starting with version 1.2, it is possible to register and deploy Docker based apps as part of streams and tasks by using Data Flow for Cloud Foundry.
If you use Spring Boot and RabbitMQ-based Docker images, you can provide a common deployment property
to facilitate binding the apps to the RabbitMQ service. Assuming your RabbitMQ service is named
rabbit
, you can provide the following:
cf set-env dataflow-server SPRING_APPLICATION_JSON '{"spring.cloud.dataflow.applicationProperties.stream.spring.rabbitmq.addresses": "${vcap.services.rabbit.credentials.protocols.amqp.uris}"}'
For Spring Cloud Task apps, you can use something similar to the following, if you use a database service instance named
postgres
:
cf set-env SPRING_DATASOURCE_URL '${vcap.services.postgres.credentials.jdbcUrl}'
cf set-env SPRING_DATASOURCE_USERNAME '${vcap.services.postgres.credentials.username}'
cf set-env SPRING_DATASOURCE_PASSWORD '${vcap.services.postgres.credentials.password}'
cf set-env SPRING_DATASOURCE_DRIVER_CLASS_NAME 'org.mariadb.jdbc.Driver'
For non-Java or non-Boot applications, your Docker app must parse the
VCAP_SERVICES
variable in order to bind to any available services.
When using non-Boot applications, chances are that you want to pass the application properties by using traditional
environment variables, as opposed to using the special
SPRING_APPLICATION_JSON
variable. To do so, set the
following variables for streams and tasks, respectively:
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_USE_SPRING_APPLICATION_JSON=false
When deploying streams in Cloud Foundry, you can take advantage of application-specific service bindings, so not all services are globally configured for all the apps orchestrated by Spring Cloud Data Flow.
For instance, if you want to provide a
postgres
service binding only for the
jdbc
application in the following stream
definition, you can pass the service binding as a deployment property:
dataflow:>stream create --name httptojdbc --definition "http | jdbc"
dataflow:>stream deploy --name httptojdbc --properties "deployer.jdbc.cloudfoundry.services=postgresService"
where
postgresService
is the name of the service specifically bound only to the
jdbc
application and the
http
application does not get the binding by this method.
If you have more than one service to bind, they can be passed as comma-separated items
(for example:
deployer.jdbc.cloudfoundry.services=postgresService,someService
).
The CloudFoundry API supports providing configuration parameters when binding a service instance. Some service brokers require or recommend binding configuration. For example, binding the Google Cloud Platform service using the CF CLI looks something like:
cf bind-service my-app my-google-bigquery-example -c '{"role":"bigquery.user"}'
Likewise the NFS Volume Service supports binding configuration such as:
cf bind-service my-app nfs_service_instance -c '{"uid":"1000","gid":"1000","mount":"/var/volume1","readonly":true}'
Starting with version 2.0, Data Flow for Cloud Foundry allows you to provide binding configuration parameters may be provided in the app level or server level
cloudfoundry.services
deployment property. For example, to bind to the nfs service, as above :
dataflow:> stream deploy --name mystream --properties "deployer.<app>.cloudfoundry.services='nfs_service_instance uid:1000,gid:1000,mount:/var/volume1,readonly:true'"
The format is intended to be compatible with the Data Flow DSL parser.
Generally, the
cloudfoundry.services
deployment property accepts a comma delimited value.
Since a comma is also used to separate configuration parameters, and to avoid white space issues, any item including configuration parameters must be enclosed in singe quotes. Valid values incude things like:
rabbitmq,'nfs_service_instance uid:1000,gid:1000,mount:/var/volume1,readonly:true',postgres,'my-google-bigquery-example role:bigquery.user'
In addition to marketplace services, Cloud Foundry supports User-provided Services (UPS). Throughout this reference manual, regular services have been mentioned, but there is nothing precluding the use of User-provided Services as well, whether for use as the messaging middleware (for example, if you want to use an external Apache Kafka installation) or for use by some of the stream applications (for example, an Oracle Database).
Now we review an example of extracting and supplying the connection credentials from a UPS.
The following example shows a sample UPS setup for Apache Kafka:
cf create-user-provided-service kafkacups -p '{”brokers":"HOST:PORT","zkNodes":"HOST:PORT"}'
The UPS credentials are wrapped within
VCAP_SERVICES
, and they can be supplied directly in the stream definition, as
the following example shows.
stream create fooz --definition "time | log"
stream deploy fooz --properties "app.time.spring.cloud.stream.kafka.binder.brokers=${vcap.services.kafkacups.credentials.brokers},app.time.spring.cloud.stream.kafka.binder.zkNodes=${vcap.services.kafkacups.credentials.zkNodes},app.log.spring.cloud.stream.kafka.binder.brokers=${vcap.services.kafkacups.credentials.brokers},app.log.spring.cloud.stream.kafka.binder.zkNodes=${vcap.services.kafkacups.credentials.zkNodes}"
As of Data Flow 2.0, the Spring Cloud Connector library is no longer used to create the DataSource. The library java-cfenv is now used which allows you to set Spring Boot properties to configure the connection pool.
By default, every application in Cloud Foundry starts with 1G disk quota and this can be adjusted to a default maximum of 2G. The default maximum can also be overridden up to 10G by using Pivotal Cloud Foundry’s (PCF) Ops Manager GUI.
This configuration is relevant for Spring Cloud Data Flow because every task deployment is composed of applications (typically Spring Boot uber-jar’s), and those applications are resolved from a remote maven repository. After resolution, the application artifacts are downloaded to the local Maven Repository for caching and reuse. With this happening in the background, the default disk quota (1G) can fill up rapidly, especially when we experiment with streams that are made up of unique applications. In order to overcome this disk limitation and depending on your scaling requirements, you may want to change the default maximum from 2G to 10G. Let’s review the steps to change the default maximum disk quota allocation.
From PCF’s Ops Manager, select the “Pivotal Elastic Runtime” tile and navigate to the “Application Developer Controls” tab. Change the “Maximum Disk Quota per App (MB)” setting from 2048 (2G) to 10240 (10G). Save the disk quota update and click “Apply Changes” to complete the configuration override.
Once the disk quota change has been successfully applied and assuming you have a
running application
,
you can scale the application with a new
disk_limit
through the CF CLI, as the following example shows:
→ cf scale dataflow-server -k 10GB
Scaling app dataflow-server in org ORG / space SPACE as user...
state since cpu memory disk details
#0 running 2016-10-31 03:07:23 PM 1.8% 497.9M of 1.1G 193.9M of 10G
You can then list the applications and see the new maximum disk space, as the following example shows:
→ cf apps
Getting apps in org ORG / space SPACE as user...
name requested state instances memory disk urls
dataflow-server started 1/1 1.1G 10G dataflow-server.apps.io
Even when configuring the Data Flow server to use 10G of space, there is the possibility of exhausting
the available space on the local disk. To prevent this,
jar
artifacts downloaded from external sources, i.e., apps registered as
http
or
maven
resources, are automatically deleted whenever the application is deployed, whether or not the deployment request succeeds.
This behavior is optimal for production environments in which container runtime stability is more critical than I/O latency incurred during deployment.
In development environments deployment happens more frequently. Additionally, the
jar
artifact (or a lighter
metadata
jar) contains metadata describing application configuration properties
which is used by various operations related to application configuration, more frequently performed during pre-production activities (see
Application Metadata
for details).
To provide a more responsive interactive developer experience at the expense of more disk usage in pre-production environments, you can set the CloudFoundry deployer property
autoDeleteMavenArtifacts
to
false
.
If you deploy the Data Flow server by using the default
port
health check type, you must explicitly monitor the disk space on the server in order to avoid running out space.
If you deploy the server by using the
http
health check type (see the next example), the Data Flow server is restarted if there is low disk space.
This is due to Spring Boot’s
Disk Space Health Indicator
.
You can
configure
the settings of the Disk Space Health Indicator by using the properties that have the
management.health.diskspace
prefix.
For version 1.7, we are investigating the use of
Volume Services
for the Data Flow server to store
.jar
artifacts before pushing them to Cloud Foundry.
The following example shows how to deploy the
http
health check type to an endpoint called
/management/health
:
Though we recommend using a Maven Artifactory for application Register a Stream Application , there might be situations where one of the following alternative approaches would make sense.
With the help of Spring Boot, we can serve
static content
in Cloud Foundry. A simple Spring Boot application can bundle all the required stream and task applications. By having it
run on Cloud Foundry, the static application can then serve the über-jar’s. From the shell, you can, for example, register the
application with the name
http-source.jar
by using
--uri=http://<Route-To-StaticApp>/http-source.jar
.
The über-jar’s can be hosted on any external server that’s reachable over HTTP. They can be resolved from raw GitHub URIs
as well. From the shell, you can, for example, register the app with the name
http-source.jar
by using
--uri=http://<Raw_GitHub_URI>/http-source.jar
.
Static Buildpack support in Cloud Foundry is another option. A similar HTTP resolution works on this model, too.
Volume Services
is another great option.
The required über-jars can be hosted in an external file system. With the help of volume-services, you can, for
example, register the application with the name
http-source.jar
by using
--uri=file://<Path-To-FileSystem>/http-source.jar
.
By default, the Data Flow server is unsecured and runs on an unencrypted HTTP connection. You can secure your REST endpoints
(as well as the Data Flow Dashboard) by enabling HTTPS and requiring clients to authenticate.
For more details about securing the
REST endpoints and configuring to authenticate against an OAUTH backend (UAA and SSO running on Cloud Foundry),
see the security section from the core
Security Configuration
. You can configure the security details in
dataflow-server.yml
or pass them as environment variables through
cf set-env
commands.
Spring Cloud Data Flow can either integrate with Pivotal Single Sign-On Service (for example, on PWS) or Cloud Foundry User Account and Authentication (UAA) Server.
When deploying Spring Cloud Data Flow to Cloud Foundry, you can bind the application to the Pivotal Single Sign-On Service. By doing so, Spring Cloud Data Flow takes advantage of the Java CFEnv , which provides Cloud Foundry-specific auto-configuration support for OAuth 2.0.
To do so, bind the Pivotal Single Sign-On Service to your Data Flow Server application and provide the following properties:
SPRING_CLOUD_DATAFLOW_SECURITY_CFUSEUAA: false (1)
SECURITY_OAUTH2_CLIENT_CLIENTID: "${security.oauth2.client.clientId}"
SECURITY_OAUTH2_CLIENT_CLIENTSECRET: "${security.oauth2.client.clientSecret}"
SECURITY_OAUTH2_CLIENT_ACCESSTOKENURI: "${security.oauth2.client.accessTokenUri}"
SECURITY_OAUTH2_CLIENT_USERAUTHORIZATIONURI: "${security.oauth2.client.userAuthorizationUri}"
SECURITY_OAUTH2_RESOURCE_USERINFOURI: "${security.oauth2.resource.userInfoUri}"
Authorization is similarly supported for non-Cloud Foundry security scenarios. See the security section from the core Data Flow Security Configuration .
As the provisioning of roles can vary widely across environments, we by default assign all Spring Cloud Data Flow roles to users.
You can customize this behavior by providing your own
AuthoritiesExtractor
.
The following example shows one possible approach to set the custom
AuthoritiesExtractor
on the
UserInfoTokenServices
:
public class MyUserInfoTokenServicesPostProcessor
implements BeanPostProcessor {
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
if (bean instanceof UserInfoTokenServices) {
final UserInfoTokenServices userInfoTokenServices == (UserInfoTokenServices) bean;
userInfoTokenServices.setAuthoritiesExtractor(ctx.getBean(AuthoritiesExtractor.class));
return bean;
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
return bean;
Then you can declare it in your configuration class as follows:
@Bean
public BeanPostProcessor myUserInfoTokenServicesPostProcessor() {
BeanPostProcessor postProcessor == new MyUserInfoTokenServicesPostProcessor();
return postProcessor;
Cloud Foundry UAA
The availability of Cloud Foundry User Account and Authentication (UAA) depends on the Cloud Foundry environment.
In order to provide UAA integration, you have to provide the necessary
OAuth2 configuration properties (for example, by setting the SPRING_APPLICATION_JSON
property).
The following JSON example shows how to create a security configuration:
"security.oauth2.client.client-id": "scdf",
"security.oauth2.client.client-secret": "scdf-secret",
"security.oauth2.client.access-token-uri": "https://login.cf.myhost.com/oauth/token",
"security.oauth2.client.user-authorization-uri": "https://login.cf.myhost.com/oauth/authorize",
"security.oauth2.resource.user-info-uri": "https://login.cf.myhost.com/userinfo"
By default, the spring.cloud.dataflow.security.cf-use-uaa
property is set to true
. This property activates a special
AuthoritiesExtractor
called CloudFoundryDataflowAuthoritiesExtractor
.
If you do not use CloudFoundry UAA, you should set spring.cloud.dataflow.security.cf-use-uaa
to false
.
Under the covers, this AuthoritiesExtractor
calls out to the
Cloud Foundry
Apps API and ensure that users are in fact Space Developers.
If the authenticated user is verified as a Space Developer, all roles are assigned.
10.16. Configuration Reference
You must provide several pieces of configuration. These are Spring Boot @ConfigurationProperties
, so you can set
them as environment variables or by any other means that Spring Boot supports. The following listing is in environment
variable format, as that is an easy way to get started configuring Boot applications in Cloud Foundry.
Note that in the future, you will be able to deploy tasks to multiple platforms, but for 2.0.0.M1 you can deploy only to a single platform and the name must be default
.
# Default values appear after the equal signs.
# Example values, typical for Pivotal Web Services, are included as comments.
# URL of the CF API (used when using cf login -a for example) - for example, https://api.run.pivotal.io
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_URL=
# The name of the organization that owns the space above - for example, youruser-org
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_ORG=
# The name of the space into which modules will be deployed - for example, development
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_SPACE=
# The root domain to use when mapping routes - for example, cfapps.io
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_DOMAIN=
# The user name and password of the user to use to create applications
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_USERNAME=
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_PASSWORD
# The identity provider to be used when accessing the Cloud Foundry API (optional).
# The passed string has to be a URL-Encoded JSON Object, containing the field origin with value as origin_key of an identity provider - for example, {"origin":"uaa"}
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_LOGIN_HINT=
# Whether to allow self-signed certificates during SSL validation (you should NOT do so in production)
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_SKIP_SSL_VALIDATION
# A comma-separated set of service instance names to bind to every deployed task application.
# Among other things, this should include an RDBMS service that is used
# for Spring Cloud Task execution reporting, such as my_postgres
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_SERVICES
spring.cloud.deployer.cloudfoundry.task.services=
# Timeout, in seconds, to use when doing blocking API calls to Cloud Foundry
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_API_TIMEOUT=
# Timeout, in milliseconds, to use when querying the Cloud Foundry API to compute app status
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_STATUS_TIMEOUT
Note that you can set spring.cloud.deployer.cloudfoundry.services
,
spring.cloud.deployer.cloudfoundry.buildpacks
, or the Spring Cloud Deployer-standard
spring.cloud.deployer.memory
and spring.cloud.deployer.disk
as part of an individual deployment request by using the deployer.<app-name>
shortcut, as the following example shows:
stream create --name ticktock --definition "time | log"
stream deploy --name ticktock --properties "deployer.time.memory=2g"
The commands in the preceding example deploy the time source with 2048MB of memory, while the log sink uses the default 1024MB.
When you deploy a stream, you can also pass JAVA_OPTS
as a deployment property, as the following example shows:
stream deploy --name ticktock --properties "deployer.time.cloudfoundry.javaOpts=-Duser.timezone=America/New_York"
10.17. Debugging
If you want to get better insights into what is happening when your streams and tasks are being deployed, you may want
to turn on the following features:
Reactor “stacktraces”, showing which operators were involved before an error occurred. This feature is helpful, as the deployer
relies on project reactor and regular stacktraces may not always allow understanding the flow before an error happened.
Note that this comes with a performance penalty, so it is disabled by default.
Deployer and Cloud Foundry client library request and response logs. This feature allows seeing a detailed conversation between
the Data Flow server and the Cloud Foundry Cloud Controller.
10.18. Spring Cloud Config Server
You can use Spring Cloud Config Server to centralize configuration properties for Spring Boot applications.
Likewise, both Spring Cloud Data Flow and the applications orchestrated by Spring Cloud Data Flow can be integrated with a configuration server to use the same capabilities.
10.18.1. Stream, Task, and Spring Cloud Config Server
Similar to Spring Cloud Data Flow server, you can configure both the stream and task applications to resolve the centralized properties from the configuration server.
Setting the spring.cloud.config.uri
property for the deployed applications is a common way to bind to the configuration server.
See the Spring Cloud Config Client reference guide for more information.
Since this property is likely to be used across all deployed applications, the Data Flow server’s spring.cloud.dataflow.applicationProperties.stream
property for stream applications and spring.cloud.dataflow.applicationProperties.task
property for task applications can be used to pass the uri
of the Config Server to each deployed stream or task application. See the section on Common Application Properties for more information.
Note that, if you use the out-of-the-box Stream Applications, these applications already embed the spring-cloud-services-starter-config-client
dependency.
If you build your application from scratch and want to add the client side support for config server, you can add a dependency reference to the config server client library. The following snippet shows a Maven example:
<dependency>
<groupId>io.pivotal.spring.cloud</groupId>
<artifactId>spring-cloud-services-starter-config-client</artifactId>
<version>CONFIG_CLIENT_VERSION</version>
</dependency>
where CONFIG_CLIENT_VERSION
can be the latest release of the Spring Cloud Config Server
client for Pivotal Cloud Foundry.
You may see a WARN
logging message if the application that uses this library cannot connect to the configuration
server when the application starts and whenever the /health
endpoint is accessed.
If you know that you are not using config server functionality, you can disable the client library by setting the
SPRING_CLOUD_CONFIG_ENABLED
environment variable to false
.
10.18.2. Sample Manifest Template
The following SCDF and Skipper manifest.yml
templates includes the required environment variables for the Skipper and Spring Cloud Data Flow server and deployed applications and tasks to successfully run on Cloud Foundry and automatically resolve centralized properties from my-config-server
at runtime:
SCDF manifest.yml
applications:
- name: data-flow-server
host: data-flow-server
memory: 2G
disk_quota: 2G
instances: 1
path: {PATH TO SERVER UBER-JAR}
SPRING_APPLICATION_NAME: data-flow-server
MAVEN_REMOTE_REPOSITORIES_REPO1_URL: https://repo.spring.io/libs-snapshot
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_URL: https://api.sys.huron.cf-app.com
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_ORG: sabby20
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_SPACE: sabby20
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_DOMAIN: apps.huron.cf-app.com
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_USERNAME: admin
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_PASSWORD: ***
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_SKIP_SSL_VALIDATION: true
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_SERVICES: postgres
SPRING_CLOUD_SKIPPER_CLIENT_SERVER_URI: https://<skipper-host-name>/api
services:
- postgres
- my-config-server
Skipper manifest.yml
applications:
- name: skipper-server
host: skipper-server
memory: 1G
disk_quota: 1G
instances: 1
timeout: 180
buildpack: java_buildpack
path: <PATH TO THE DOWNLOADED SKIPPER SERVER UBER-JAR>
SPRING_APPLICATION_NAME: skipper-server
SPRING_CLOUD_SKIPPER_SERVER_ENABLE_LOCAL_PLATFORM: false
SPRING_CLOUD_SKIPPER_SERVER_STRATEGIES_HEALTHCHECK_TIMEOUTINMILLIS: 300000
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_URL: https://api.local.pcfdev.io
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_ORG: pcfdev-org
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_SPACE: pcfdev-space
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_DOMAIN: cfapps.io
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_USERNAME: admin
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_PASSWORD: admin
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_SKIP_SSL_VALIDATION: false
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_DELETE_ROUTES: false
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_SERVICES: rabbit,my-config-server
services:
- postgres
my-config-server
where my-config-server
is the name of the Spring Cloud Config Service instance running on Cloud Foundry.
By binding the service to Spring Cloud Data Flow server, Spring Cloud Task and via Skipper to all the Spring Cloud Stream applications respectively, we can now resolve centralized properties backed by this service.
10.18.3. Self-signed SSL Certificate and Spring Cloud Config Server
Often, in a development environment, we may not have a valid certificate to enable SSL communication between clients and the backend services.
However, the configuration server for Pivotal Cloud Foundry uses HTTPS for all client-to-service communication, so we need to add a self-signed SSL certificate in environments with no valid certificates.
By using the same manifest.yml
templates listed in the previous section for the server, we can provide the self-signed SSL certificate by setting TRUST_CERTS: <API_ENDPOINT>
.
However, the deployed applications also require TRUST_CERTS
as a flat environment variable (as opposed to being wrapped inside SPRING_APPLICATION_JSON
), so we must instruct the server with yet another set of tokens (SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_USE_SPRING_APPLICATION_JSON: false
) for tasks.
With this setup, the applications receive their application properties as regular environment variables.
The following listing shows the updated manifest.yml
with the required changes. Both the Data Flow server and deployed applications
get their configuration from the my-config-server
Cloud Config server (deployed as a Cloud Foundry service).
applications:
- name: test-server
host: test-server
memory: 1G
disk_quota: 1G
instances: 1
path: spring-cloud-dataflow-server-VERSION.jar
SPRING_APPLICATION_NAME: test-server
MAVEN_REMOTE_REPOSITORIES_REPO1_URL: https://repo.spring.io/libs-snapshot
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_URL: https://api.sys.huron.cf-app.com
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_ORG: sabby20
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_SPACE: sabby20
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_DOMAIN: apps.huron.cf-app.com
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_USERNAME: admin
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_PASSWORD: ***
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_SKIP_SSL_VALIDATION: true
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_SERVICES: postgres, config-server
SPRING_CLOUD_SKIPPER_CLIENT_SERVER_URI: https://<skipper-host-name>/api
TRUST_CERTS: <API_ENDPOINT> #this is for the server
SPRING_CLOUD_DATAFLOW_APPLICATION_PROPERTIES_TASK_TRUST_CERTS: <API_ENDPOINT> #this propagates to all tasks
services:
- postgres
- my-config-server #this is for the server
Also add the my-config-server
service to the Skipper’s manifest environment
applications:
- name: skipper-server
host: skipper-server
memory: 1G
disk_quota: 1G
instances: 1
timeout: 180
buildpack: java_buildpack
path: <PATH TO THE DOWNLOADED SKIPPER SERVER UBER-JAR>
SPRING_APPLICATION_NAME: skipper-server
SPRING_CLOUD_SKIPPER_SERVER_ENABLE_LOCAL_PLATFORM: false
SPRING_CLOUD_SKIPPER_SERVER_STRATEGIES_HEALTHCHECK_TIMEOUTINMILLIS: 300000
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_URL: <URL>
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_ORG: <ORG>
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_SPACE: <SPACE>
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_DOMAIN: <DOMAIN>
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_USERNAME: <USER>
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_PASSWORD: <PASSWORD>
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_SERVICES: rabbit, my-config-server #this is so all stream applications bind to my-config-server
services:
- postgres
my-config-server
Before following these instructions, be sure to have an instance of the PCF-Scheduler service running in your Cloud Foundry space.
To create a PCF-Scheduler in your space (assuming it is in your Market Place) execute the following from the CF CLI: cf create-service scheduler-for-pcf standard <name of service>
.
Name of a service is later used to bound running application in PCF.
Enable scheduling for Spring Cloud Data Flow by setting spring.cloud.dataflow.features.schedules-enabled
to true
.
Bind the task deployer to your instance of PCF-Scheduler by adding the PCF-Scheduler service name to the SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_SERVICES
environment variable.
Establish the URL to the PCF-Scheduler by setting the SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_SCHEDULER_SCHEDULER_URL
environment variable.
SPRING_APPLICATION_NAME: data-flow-server
SPRING_CLOUD_SKIPPER_SERVER_ENABLE_LOCAL_PLATFORM: false
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_URL: <URL>
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_ORG: <ORG>
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_SPACE: <SPACE>
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_DOMAIN: <DOMAIN>
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_USERNAME: <USER>
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_CONNECTION_PASSWORD: <PASSWORD>
SPRING_CLOUD_SKIPPER_SERVER_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_DEPLOYMENT_SERVICES: rabbit, myscheduler
SPRING_CLOUD_DATAFLOW_FEATURES_SCHEDULES_ENABLED: true
SPRING_CLOUD_SKIPPER_CLIENT_SERVER_URI: https://<skipper-host-name>/api
SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]_SCHEDULER_SCHEDULER_URL: https://scheduler.local.pcfdev.io
services:
- postgres
Where the SPRING_CLOUD_DATAFLOW_TASK_PLATFORM_CLOUDFOUNDRY_ACCOUNTS[default]SCHEDULER_SCHEDULER_URL
has the following format: scheduler.<Domain-Name>
(for
example, scheduler.local.pcfdev.io
). Check the actual address from your _PCF environment.
This section describes how to configure Spring Cloud Data Flow features, such as deployer properties, tasks, and which relational database to use.
11.1. Feature Toggles
Data Flow server offers specific set of features that can be enabled or disabled when launching. These features include all the lifecycle operations, REST endpoints (server and client implementations including Shell and the UI) for:
11.2. Application and Server Properties
This section covers how you can customize the deployment of your applications. You can use a number of properties to influence settings for the applications that are deployed. Properties can be applied on a per-application basis or in the appropriate server configuration for all deployed applications.
Properties to be applied for all deployed Tasks are defined in the src/kubernetes/server/server-config-[binder].yaml
file and for Streams in src/kubernetes/skipper/skipper-config-[binder].yaml
. Replace [binder]
with the messaging middleware you are using — for example, rabbit
or kafka
.
11.2.1. Memory and CPU Settings
Applications are deployed with default memory and CPU settings. If you need to, you can adjust these values. The following example shows how to set Limits
to 1000m
for CPU
and 1024Mi
for memory and Requests
to 800m
for CPU and 640Mi
for memory:
deployer.<application>.kubernetes.limits.cpu=1000m
deployer.<application>.kubernetes.limits.memory=1024Mi
deployer.<application>.kubernetes.requests.cpu=800m
deployer.<application>.kubernetes.requests.memory=640Mi
11.2.2. Environment Variables
To influence the environment settings for a given application, you can use the spring.cloud.deployer.kubernetes.environmentVariables
deployer property.
For example, a common requirement in production settings is to influence the JVM memory arguments.
You can do so by using the JAVA_TOOL_OPTIONS
environment variable, as the following example shows:
The environmentVariables
property accepts a comma-delimited string. If an environment variable contains a value
that is also a comma-delimited string, it must be enclosed in single quotation marks — for example,
spring.cloud.deployer.kubernetes.environmentVariables=spring.cloud.stream.kafka.binder.brokers='somehost:9092,
anotherhost:9093'
11.2.3. Liveness, Readiness and Startup Probes
The liveness
and readiness
probes use paths called /health
and /info
, respectively. They use a delay
of 1
for both and a period
of 60
and 10
respectively. You can change these defaults when you deploy the stream by using deployer properties. The liveness and readiness probes are applied only to streams.
The startup
probe will use the /health
path and a delay of 30 and period for 3 with a failure threshold of 20 times before the container restarts the application.
The following example changes the liveness
and startup
probes (replace <application>
with the name of your application) by setting deployer properties:
deployer.<application>.kubernetes.livenessProbePath=/health
deployer.<application>.kubernetes.livenessProbeDelay=1
deployer.<application>.kubernetes.livenessProbePeriod=60
deployer.<application>.kubernetes.livenessProbeSuccess=1
deployer.<application>.kubernetes.livenessProbeFailure=3
deployer.<application>.kubernetes.startupHttpProbePath=/health
deployer.<application>.kubernetes.startupProbedelay=20
deployer.<application>.kubernetes.startupProbeSuccess=1
deployer.<application>.kubernetes.startupProbeFailure=30
deployer.<application>.kubernetes.startupProbePeriod=5
deployer.<application>.kubernetes.startupProbeTimeout=3
Similarly, you can swap liveness
for readiness
to override the default readiness
settings.
By default, port 8080 is used as the probe port. You can change the defaults for both liveness
and readiness
probe ports by using deployer properties, as the following example shows:
deployer.<application>.kubernetes.readinessProbePort=7000
deployer.<application>.kubernetes.livenessProbePort=7000
deployer.<application>.kubernetes.startupProbePort=7000
By default, the liveness
and readiness
probe paths use Spring Boot 2.x+ actuator endpoints. To use Spring Boot 1.x actuator endpoint paths, you must adjust the liveness
and readiness
values, as the following example shows (replace <application>
with the name of your application):
The startup
probe path will default to the management path /info
but may be modified as needed.
You can access secured probe endpoints by using credentials stored in a Kubernetes secret. You can use an existing secret, provided the credentials are contained under the credentials
key name of the secret’s data
block. You can configure probe authentication on a per-application basis. When enabled, it is applied to both the liveness
and readiness
probe endpoints by using the same credentials and authentication type. Currently, only Basic
authentication is supported.
To create a new secret:
Generate the base64 string with the credentials used to access the secured probe endpoints.
Basic authentication encodes a username and a password as a base64 string in the format of username:password
.
The following example (which includes output and in which you should replace user
and pass
with your values) shows how to generate a base64 string:
11.2.4. Using SPRING_APPLICATION_JSON
You can use a SPRING_APPLICATION_JSON
environment variable to set Data Flow server properties (including the configuration of Maven repository settings) that are common across all of the Data Flow server implementations. These settings go at the server level in the container env
section of a deployment YAML. The following example shows how to do so:
11.2.5. Private Docker Registry
You can pull Docker images from a private registry on a per-application basis. First, you must create a secret in the cluster. Follow the Pull an Image from a Private Registry guide to create the secret.
Once you have created the secret, you can use the imagePullSecret
property to set the secret to use, as the following example shows:
Replace <application>
with the name of your application and mysecret
with the name of the secret you created earlier.
You can also configure the image pull secret at the global server level.
The following example shows how to do so for streams:
11.2.6. Annotations
You can add annotations to Kubernetes objects on a per-application basis. The supported object types are pod Deployment
, Service
, and Job
. Annotations are defined in a key:value
format, allowing for multiple annotations separated by a comma. For more information and use cases on annotations, see Annotations.
The following example shows how you can configure applications to use annotations:
deployer.<application>.kubernetes.podAnnotations=annotationName:annotationValue
deployer.<application>.kubernetes.serviceAnnotations=annotationName:annotationValue,annotationName2:annotationValue2
deployer.<application>.kubernetes.jobAnnotations=annotationName:annotationValue
exec
(default): Passes all application properties and command line arguments in the deployment request as container arguments. Application properties are transformed into the format of --key=value
.
shell
: Passes all application properties and command line arguments as environment variables. Each of the applicationor command-line argument properties is transformed into an uppercase string and .
characters are replaced with _
.
boot
: Creates an environment variable called SPRING_APPLICATION_JSON
that contains a JSON representation of all application properties. Command line arguments from the deployment request are set as container args.
Replace <application>
with the name of your application and <Entry Point Style>
with your desired entry point style.
You can also configure the entry point style at the global server level.
The following example shows how to do so for streams:
You should choose an Entry Point Style of either exec
or shell
, to correspond to how the ENTRYPOINT
syntax is defined in the container’s Dockerfile
. For more information and uses cases on exec
versus shell
, see the ENTRYPOINT section of the Docker documentation.
Using the boot
entry point style corresponds to using the exec
style ENTRYPOINT
. Command line arguments from the deployment request are passed to the container, with the addition of application properties being mapped into the SPRING_APPLICATION_JSON
environment variable rather than command line arguments.
Replace <application>
with the name of your application and myserviceaccountname
with your service account name.
You can also configure the service account name at the global server level.
The following example shows how to do so for streams:
Replace <application>
with the name of your application and Always
with your desired image pull policy.
You can configure an image pull policy at the global server level.
The following example shows how to do so for streams:
11.2.10. Deployment Labels
You can set custom labels on objects related to Deployment. See Labels for more information on labels. Labels are specified in key:value
format.
The following example shows how you can individually configure applications:
Replace <application>
with the name of your application, myLabelName
with your label name, and myLabelValue
with the value of your label.
Additionally, you can apply multiple labels, as the following example shows:
11.2.11. Tolerations
Tolerations work with taints to ensure pods are not scheduled onto particular nodes.
Tolerations are set into the pod configuration while taints are set onto nodes.
See the Taints and Tolerations section of the Kubernetes reference for more information.
The following example shows how you can individually configure applications:
Replace <application>
with the name of your application and the key-value pairs according to your desired toleration configuration.
You can configure tolerations at the global server level as well.
The following example shows how to do so for streams:
11.2.12. Secret References
Secrets can be referenced and their entire data contents can be decoded and inserted into the pod environment as individual variables.
See the Configure all key-value pairs in a Secret as container environment variables section of the Kubernetes reference for more information.
The following example shows how you can individually configure applications:
Replace <application>
with the name of your application and the secretRefs
attribute with the appropriate values for your application environment and secret.
You can configure secret references at the global server level as well.
The following example shows how to do so for streams:
11.2.13. Secret Key References
Secrets can be referenced and their decoded value can be inserted into the pod environment.
See the Using Secrets as Environment Variables section of the Kubernetes reference for more information.
The following example shows how you can individually configure applications:
Replace <application>
with the name of your application and the envVarName
, secretName
, and dataKey
attributes with the appropriate values for your application environment and secret.
You can configure secret key references at the global server level as well.
The following example shows how to do so for streams:
11.2.14. ConfigMap References
A ConfigMap can be referenced and its entire data contents can be decoded and inserted into the pod environment as individual variables.
See the Configure all key-value pairs in a ConfigMap as container environment variables section of the Kubernetes reference for more information.
The following example shows how you can individually configure applications:
Replace <application>
with the name of your application and the configMapRefs
attribute with the appropriate values for your application environment and ConfigMap.
You can configure ConfigMap references at the global server level as well.
The following example shows how to do so for streams. Edit the appropriate skipper-config-(binder).yaml
, replacing (binder)
with the corresponding binder in use:
11.2.15. ConfigMap Key References
A ConfigMap can be referenced and its associated key value inserted into the pod environment.
See the Define container environment variables using ConfigMap data section of the Kubernetes reference for more information.
The following example shows how you can individually configure applications:
Replace <application>
with the name of your application and the envVarName
, configMapName
, and dataKey
attributes with the appropriate values for your application environment and ConfigMap.
You can configure ConfigMap references at the global server level as well.
The following example shows how to do so for streams. Edit the appropriate skipper-config-(binder).yaml
, replacing (binder)
with the corresponding binder in use:
11.2.16. Pod Security Context
The pod security context specifies security settings for a pod and its containers.
The configurable options are listed HERE
(more details for each option can be found in the Pod Security Context section of the Kubernetes API reference).
The following example shows how you can configure the security context for an individual application pod:
Replace <application>
with the name of your application and any attributes with the appropriate values for your container environment.
You can configure the pod security context at the global server level as well.
The following example shows how to do so for streams. Edit the appropriate skipper-config-(binder).yaml
, replacing (binder)
with the corresponding binder in use:
11.2.17. Container Security Context
The container security context specifies security settings for an individual container.
The configurable options are listed HERE
(more details for each option can be found in the Container Security Context section of the Kubernetes API reference).
Replace <application>
with the name of your application and any attributes with the appropriate values for your container environment.
You can configure the container security context at the global server level as well.
The following example shows how to do so for streams. Edit the appropriate skipper-config-(binder).yaml
, replacing (binder)
with the corresponding binder in use:
11.2.18. Service Ports
When you deploy applications, a kubernetes Service object is created with a default port of 8080
. If the server.port
property is set, it overrides the default port value. You can add additional ports to the Service object on a per-application basis. You can add multiple ports with a comma delimiter.
The following example shows how you can configure additional ports on a Service object for an application:
11.2.19. StatefulSet Init Container
When deploying an application by using a StatefulSet, an Init Container is used to set the instance index in the pod.
By default, the image used is busybox
, which you can be customize.
The following example shows how you can individually configure application pods:
Replace <application>
with the name of your application and the statefulSetInitContainerImageName
attribute with the appropriate value for your environment.
You can configure the StatefulSet Init Container at the global server level as well.
The following example shows how to do so for streams. Edit the appropriate skipper-config-(binder).yaml
, replacing (binder)
with the corresponding binder in use:
11.2.20. Init Containers
When you deploy applications, you can set a custom Init Container on a per-application basis.
Refer to the Init Containers section of the Kubernetes reference for more information.
The following example shows how you can configure an Init Container for an application:
11.2.21. Lifecycle Support
When you deploy applications, you may attach postStart
and preStop
Lifecycle handlers to execute commands.
The Kubernetes API supports other types of handlers besides exec
. This feature may be extended to support additional actions in a future release.
To configure the Lifecycle handlers as shown in the linked page above,specify each command as a comma-delimited list, using the following property keys:
deployer.<application>.kubernetes.lifecycle.postStart.exec.command=/bin/sh,-c,'echo Hello from the postStart handler > /usr/share/message'
deployer.<application>.kubernetes.lifecycle.preStop.exec.command=/bin/sh,-c,'nginx -s quit; while killall -0 nginx; do sleep 1; done'
11.2.22. Additional Containers
When you deploy applications, you may need one or more containers to be deployed along with the main container.
This would allow you to adapt some deployment patterns such as sidecar, adapter in case of multi container pod setup.
The following example shows how you can configure additional containers for an application:
11.3. Deployer Properties
You can use the following configuration properties the Kubernetes deployer to customize how Streams and Tasks are deployed.
When deploying with the Data Flow shell, you can use the syntax deployer.<appName>.kubernetes.<deployerPropertyName>
.
These properties are also used when configuring the Kubernetes task platforms in the Data Flow server and Kubernetes platforms in Skipper for deploying Streams.
deployment.nodeSelector
The node selectors to apply to the deployment in key:value
format. Multiple node selectors are comma separated.
imagePullSecret
Secrets for a access a private registry to pull images.
imagePullPolicy
The Image Pull Policy to apply when pulling images. Valid options are Always
, IfNotPresent
, and Never
.
IfNotPresent
livenessProbeDelay
Delay in seconds when the Kubernetes liveness check of the app container should start checking its health status.
livenessProbePeriod
Period in seconds for performing the Kubernetes liveness check of the app container.
livenessProbeTimeout
Timeout in seconds for the Kubernetes liveness check of the app container. If the health check takes longer than this value to return it is assumed as 'unavailable'.
livenessProbePath
Path that app container has to respond to for liveness check.
livenessProbePort
Port that app container has to respond on for liveness check.
startupProbeDelay
Delay in seconds when the Kubernetes startup check of the app container should start checking its health status.
startupProbePeriod
Period in seconds for performing the Kubernetes startup check of the app container.
startupProbeFailure
Number of probe failures allowed for the startup probe before the pod is restarted.
startupHttpProbePath
Path that app container has to respond to for startup check.
startupProbePort
Port that app container has to respond on for startup check.
readinessProbeDelay
Delay in seconds when the readiness check of the app container should start checking if the module is fully up and running.
readinessProbePeriod
Period in seconds to perform the readiness check of the app container.
readinessProbeTimeout
Timeout in seconds that the app container has to respond to its health status during the readiness check.
readinessProbePath
Path that app container has to respond to for readiness check.
readinessProbePort
Port that app container has to respond on for readiness check.
probeCredentialsSecret
The secret name containing the credentials to use when accessing secured probe endpoints.
limits.memory
The memory limit, maximum needed value to allocate a pod, Default unit is mebibytes, 'M' and 'G" suffixes supported
limits.cpu
The CPU limit, maximum needed value to allocate a pod
requests.memory
The memory request, guaranteed needed value to allocate a pod.
requests.cpu
The CPU request, guaranteed needed value to allocate a pod.
affinity.nodeAffinity
The node affinity expressed in YAML format. e.g. { requiredDuringSchedulingIgnoredDuringExecution: { nodeSelectorTerms: [ { matchExpressions: [ { key: 'kubernetes.io/e2e-az-name', operator: 'In', values: [ 'e2e-az1', 'e2e-az2']}]}]}, preferredDuringSchedulingIgnoredDuringExecution: [ { weight: 1, preference: { matchExpressions: [ { key: 'another-node-label-key', operator: 'In', values: [ 'another-node-label-value' ]}]}}]}
affinity.podAffinity
The pod affinity expressed in YAML format. e.g. { requiredDuringSchedulingIgnoredDuringExecution: { labelSelector: [ { matchExpressions: [ { key: 'app', operator: 'In', values: [ 'store']}]}], topologyKey: 'kubernetes.io/hostnam'}, preferredDuringSchedulingIgnoredDuringExecution: [ { weight: 1, podAffinityTerm: { labelSelector: { matchExpressions: [ { key: 'security', operator: 'In', values: [ 'S2' ]}]}, topologyKey: 'failure-domain.beta.kubernetes.io/zone'}}]}
affinity.podAntiAffinity
The pod anti-affinity expressed in YAML format. e.g. { requiredDuringSchedulingIgnoredDuringExecution: { labelSelector: { matchExpressions: [ { key: 'app', operator: 'In', values: [ 'store']}]}], topologyKey: 'kubernetes.io/hostname'}, preferredDuringSchedulingIgnoredDuringExecution: [ { weight: 1, podAffinityTerm: { labelSelector: { matchExpressions: [ { key: 'security', operator: 'In', values: [ 'S2' ]}]}, topologyKey: 'failure-domain.beta.kubernetes.io/zone'}}]}
statefulSet.volumeClaimTemplate.storageClassName
Name of the storage class for a stateful set
statefulSet.volumeClaimTemplate.storage
The storage amount. Default unit is mebibytes, 'M' and 'G" suffixes supported
environmentVariables
List of environment variables to set for any deployed app container
entryPointStyle
Entry point style used for the Docker image. Used to determine how to pass in properties. Can be exec
, shell
, and boot
createLoadBalancer
Create a "LoadBalancer" for the service created for each app. This facilitates assignment of external IP to app.
false
serviceAnnotations
Service annotations to set for the service created for each application. String of the format annotation1:value1,annotation2:value2
podAnnotations
Pod annotations to set for the pod created for each deployment. String of the format annotation1:value1,annotation2:value2
jobAnnotations
Job annotations to set for the pod or job created for a job. String of the format annotation1:value1,annotation2:value2
priorityClassName
Pod Spec priorityClassName. Create a PriorityClass in Kubernetes before using this property. See Pod Priority and Preemption
shareProcessNamespace
Will assign value to Pod.spec.shareProcessNamespace. See Share Process Namespace between Containers in a Pod
minutesToWaitForLoadBalancer
Time to wait for load balancer to be available before attempting delete of service (in minutes).
maxTerminatedErrorRestarts
Maximum allowed restarts for app that fails due to an error or excessive resource use.
maxCrashLoopBackOffRestarts
Maximum allowed restarts for app that is in a CrashLoopBackOff. Values are Always
, IfNotPresent
, Never
IfNotPresent
volumeMounts
volume mounts expressed in YAML format. e.g. [{name: 'testhostpath', mountPath: '/test/hostPath'}, {name: 'testpvc', mountPath: '/test/pvc'}, {name: 'testnfs', mountPath: '/test/nfs'}]
volumes
The volumes that a Kubernetes instance supports specifed in YAML format. e.g. [{name: testhostpath, hostPath: { path: '/test/override/hostPath' }},{name: 'testpvc', persistentVolumeClaim: { claimName: 'testClaim', readOnly: 'true' }}, {name: 'testnfs', nfs: { server: '10.0.0.1:111', path: '/test/nfs' }}]
hostNetwork
The hostNetwork setting for the deployments, see kubernetes.io/docs/api-reference/v1/definitions/#_v1_podspec
false
createDeployment
Create a "Deployment" with a "Replica Set" instead of a "Replication Controller".
createJob
Create a "Job" instead of just a "Pod" when launching tasks.
false
containerCommand
Overrides the default entry point command with the provided command and arguments.
containerPorts
Adds additional ports to expose on the container.
createNodePort
The explicit port to use when NodePort
is the Service
type.
deploymentServiceAccountName
Service account name used in app deployments. Note: The service account name used for app deployments is derived from the Data Flow servers deployment.
deploymentLabels
Additional labels to add to the deployment in key:value
format. Multiple labels are comma separated.
bootMajorVersion
The Spring Boot major version to use. Currently only used to configure Spring Boot version specific probe paths automatically. Valid options are 1
or 2
.
tolerations.key
The key to use for the toleration.
tolerations.effect
The toleration effect. See kubernetes.io/docs/concepts/configuration/taint-and-toleration for valid options.
tolerations.operator
The toleration operator. See kubernetes.io/docs/concepts/configuration/taint-and-toleration/ for valid options.
tolerations.tolerationSeconds
The number of seconds defining how long the pod will stay bound to the node after a taint is added.
tolerations.value
The toleration value to apply, used in conjunction with operator
to select to appropriate effect
.
secretRefs
The name of the secret(s) to load the entire data contents into individual environment variables. Multiple secrets may be comma separated.
secretKeyRefs.envVarName
The environment variable name to hold the secret data
secretKeyRefs.secretName
The secret name to access
secretKeyRefs.dataKey
The key name to obtain secret data from
configMapRefs
The name of the ConfigMap(s) to load the entire data contents into individual environment variables. Multiple ConfigMaps be comma separated.
configMapKeyRefs.envVarName
The environment variable name to hold the ConfigMap data
configMapKeyRefs.configMapName
The ConfigMap name to access
configMapKeyRefs.dataKey
The key name to obtain ConfigMap data from
maximumConcurrentTasks
The maximum concurrent tasks allowed for this platform instance
podSecurityContext
The security context applied to the pod expressed in YAML format. e.g. {runAsUser: 65534, fsGroup: 65534, supplementalGroups: [65534, 65535], seccompProfile: { type: 'RuntimeDefault' }}
. Note this defines the entire pod security context - smaller portions of the security context can instead be configured via the podSecurityContext.**
properties below.
podSecurityContext.runAsUser
The numeric user ID to run pod container processes under
podSecurityContext.runAsGroup
The numeric group id to run the entrypoint of the container process
podSecurityContext.runAsNonRoot
Indicates that the container must run as a non-root user
podSecurityContext.fsGroup
The numeric group ID for the volumes of the pod
podSecurityContext.fsGroupChangePolicy
Defines behavior of changing ownership and permission of the volume before being exposed inside pod (only applies to volume types which support fsGroup based ownership and permissions) - possible values are "OnRootMismatch", "Always"
podSecurityContext.supplementalGroups
The numeric group IDs applied to the pod container processes, in addition to the container’s primary group ID
podSecurityContext.seccompProfile
The seccomp options to use for the pod containers expressed in YAML format. e.g. { seccompProfile: { type: 'Localhost', localhostProfile: 'my-profiles/profile-allow.json' }}
podSecurityContext.seLinuxOptions
The SELinux context to be applied to the pod containers expressed in YAML format. e.g. { level: "s0:c123,c456" }
(not used when spec.os.name is windows).
podSecurityContext.sysctls
List of namespaced sysctls used for the pod expressed in YAML format. e.g. [{name: "kernel.shm_rmid_forced", value: 0}]
(not used when spec.os.name is windows).
podSecurityContext.windowsOptions
The Windows specific settings applied to all containers expressed in YAML format. e.g. { gmsaCredentialSpec: "specA", gmsaCredentialSpecName: "specA-name"}
(only used when spec.os.name is windows).
containerSecurityContext
The security context applied to the containers expressed in YAML format. e.g. {allowPrivilegeEscalation: true, runAsUser: 65534}
. Note this defines the entire container security context - smaller portions of the security context can instead be configured via the containerSecurityContext.**
properties below.
containerSecurityContext.allowPrivilegeEscalation
Whether a process can gain more privileges than its parent process
containerSecurityContext.capabilities
The capabilities to add/drop when running the container expressed in YAML format. e.g. { add: [ "a", "b" ], drop: [ "c" ] }
(only used when spec.os.name is not windows)
containerSecurityContext.privileged
Run container in privileged mode.
containerSecurityContext.procMount
The type of proc mount to use for the container (only used when spec.os.name is not windows)
containerSecurityContext.readOnlyRootFilesystem
Mounts the container’s root filesystem as read-only
containerSecurityContext.runAsUser
The numeric user ID to run pod container processes under
containerSecurityContext.runAsGroup
The numeric group id to run the entrypoint of the container process
containerSecurityContext.runAsNonRoot
Indicates that the container must run as a non-root user
containerSecurityContext.seccompProfile
The seccomp options to use for the pod containers expressed in YAML format. e.g. { seccompProfile: { type: 'Localhost', localhostProfile: 'my-profiles/profile-allow.json' }}
containerSecurityContext.seLinuxOptions
The SELinux context to be applied to the pod containers expressed in YAML format. e.g. { level: "s0:c123,c456" }
(not used when spec.os.name is windows).
containerSecurityContext.sysctls
List of namespaced sysctls used for the pod expressed in YAML format. e.g. [{name: "kernel.shm_rmid_forced", value: 0}]
(not used when spec.os.name is windows).
containerSecurityContext.windowsOptions
The Windows specific settings applied to all containers expressed in YAML format. e.g. { gmsaCredentialSpec: "specA", gmsaCredentialSpecName: "specA-name"}
(only used when spec.os.name is windows).
statefulSetInitContainerImageName
A custom image name to use for the StatefulSet Init Container
initContainer
An Init Container expressed in YAML format to be applied to a pod. e.g. {containerName: 'test', imageName: 'busybox:latest', commands: ['sh', '-c', 'echo hello']}
additionalContainers
Additional containers expressed in YAML format to be applied to a pod. e.g. [{name: 'c1', image: 'busybox:latest', command: ['sh', '-c', 'echo hello1'], volumeMounts: [{name: 'test-volume', mountPath: '/tmp', readOnly: true}]}, {name: 'c2', image: 'busybox:1.26.1', command: ['sh', '-c', 'echo hello2']}]
The Data Flow server is responsible for deploying Tasks.
Tasks that are launched by Data Flow write their state to the same database that is used by the Data Flow server.
For Tasks which are Spring Batch Jobs, the job and step execution data is also stored in this database.
As with Skipper, Tasks can be launched to multiple platforms.
When Data Flow is running on Kubernetes, a Task platfom must be defined.
To configure new platform accounts that target Kubernetes, provide an entry under the spring.cloud.dataflow.task.platform.kubernetes
section in your application.yaml
file for via another Spring Boot supported mechanism.
In the following example, two Kubernetes platform accounts named dev
and qa
are created.
The keys such as memory
and disk
are Cloud Foundry Deployer Properties.
spring:
cloud:
dataflow:
task:
platform:
kubernetes:
accounts:
namespace: devNamespace
imagePullPolicy: Always
entryPointStyle: exec
limits:
cpu: 4
namespace: qaNamespace
imagePullPolicy: IfNotPresent
entryPointStyle: boot
limits:
memory: 2048m
You can configure the Data Flow server that is on Kubernetes to deploy tasks to Cloud Foundry and Kubernetes. See the section on Cloud Foundry Task Platform Configuration for more information.
Detailed examples for launching and scheduling tasks across multiple platforms, are available in this section Multiple Platform Support for Tasks on dataflow.spring.io.
11.5. General Configuration
The Spring Cloud Data Flow server for Kubernetes uses the spring-cloud-kubernetes
module to process secrets that are mounted under /etc/secrets
. ConfigMaps must be mounted as application.yaml
in the /config
directory that is processed by Spring Boot. To avoid access to the Kubernetes API server the SPRING_CLOUD_KUBERNETES_CONFIG_ENABLE_API
and SPRING_CLOUD_KUBERNETES_SECRETS_ENABLE_API
are set to false
.
11.5.1. Using ConfigMap and Secrets
You can pass configuration properties to the Data Flow Server by using Kubernetes ConfigMap and secrets.
The following example shows one possible configuration, which enables MariaDB and sets a memory limit:
apiVersion: v1
kind: ConfigMap
metadata:
name: scdf-server
labels:
app: scdf-server
data:
application.yaml: |-
spring:
cloud:
dataflow:
task:
platform:
kubernetes:
accounts:
default:
limits:
memory: 1024Mi
datasource:
url: jdbc:mariadb://${MARIADB_SERVICE_HOST}:${MARIADB_SERVICE_PORT}/database
username: root
password: ${mariadb-root-password}
driverClassName: org.mariadb.jdbc.Driver
testOnBorrow: true
validationQuery: "SELECT 1"
The preceding example assumes that MariaDB is deployed with mariadb
as the service name. Kubernetes publishes the host and port values of these services as environment variables that we can use when configuring the apps we deploy.
We prefer to provide the MariaDB connection password in a Secrets file, as the following example shows:
apiVersion: v1
kind: Secret
metadata:
name: mariadb
labels:
app: mariadb
data:
mariadb-root-password: eW91cnBhc3N3b3Jk
The password is a base64-encoded value.
11.6. Database
A relational database is used to store stream and task definitions as well as the state of executed tasks.
Spring Cloud Data Flow provides schemas for MariaDB, MySQL, Oracle, PostgreSQL, Db2, SQL Server, and H2. The schema is automatically created when the server starts.
MySQL 5.7
jdbc:mysql://${db-hostname}:${db-port}/${db-name}?permitMysqlScheme
org.mariadb.jdbc.Driver
MySQL 8.0+
jdbc:mysql://${db-hostname}:${db-port}/${db-name}?allowPublicKeyRetrieval=true&useSSL=false&autoReconnect=true&permitMysqlScheme[2]
org.mariadb.jdbc.Driver
PostgresSQL
jdbc:postgres://${db-hostname}:${db-port}/${db-name}
org.postgresql.Driver
SQL Server
jdbc:sqlserver://${db-hostname}:${db-port};databasename=${db-name}&encrypt=false
com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc:db2://${db-hostname}:${db-port}/{db-name}
com.ibm.db2.jcc.DB2Driver
Oracle
jdbc:oracle:thin:@${db-hostname}:${db-port}/{db-name}
oracle.jdbc.OracleDriver
spring:
datasource:
url: jdbc:mariadb://${MARIADB_SERVICE_HOST}:${MARIADB_SERVICE_PORT}/database
username: root
password: ${mariadb-root-password}
driverClassName: org.mariadb.jdbc.Driver
Similarly, for PostgreSQL you could use the following configuration:
data:
application.yaml: |-
spring:
datasource:
url: jdbc:postgresql://${PGSQL_SERVICE_HOST}:${PGSQL_SERVICE_PORT}/database
username: root
password: ${postgres-password}
driverClassName: org.postgresql.Driver
The following YAML snippet from a Deployment is an example of mounting a ConfigMap as
application.yaml
under
/config
where Spring Boot will process it plus a Secret mounted under
/etc/secrets
where it will get picked up by the spring-cloud-kubernetes library due to the environment variable
SPRING_CLOUD_KUBERNETES_SECRETS_PATHS
being set to
/etc/secrets
.
You can find migration scripts for specific database types in the spring-cloud-task repo.
We recommend using the
kubectl
command for troubleshooting streams and tasks.
You can list all artifacts and resources used by using the following command:
kubectl get all,cm,secrets,pvc
You can list all resources used by a specific application or service by using a label to select resources. The following command lists all resources used by the
mariadb
service:
kubectl get all -l app=mariadb
You can get the logs for a specific pod by issuing the following command:
kubectl logs pod <pod-name>
If the pod is continuously getting restarted, you can add
-p
as an option to see the previous log, as follows:
kubectl logs -p <pod-name>
You can also tail or follow a log by adding an
-f
option, as follows:
kubectl logs -f <pod-name>
A useful command to help in troubleshooting issues, such as a container that has a fatal error when starting up, is to use the
describe
command, as the following example shows:
kubectl describe pod ticktock-log-0-qnk72
You can access the server logs by using the following command:
kubectl get pod -l app=scdf=server
kubectl logs <scdf-server-pod-name>
Stream applications are deployed with the stream name followed by the name of the application. For processors and sinks, an instance index is also appended.
To see all the pods that are deployed by the Spring Cloud Data Flow server, you can specify the
role=spring-app
label, as follows:
kubectl get pod -l role=spring-app
To see details for a specific application deployment you can use the following command:
kubectl describe pod <app-pod-name>
To view the application logs, you can use the following command:
kubectl logs <app-pod-name>
If you would like to tail a log you can use the following command:
kubectl logs -f <app-pod-name>
Tasks are launched as bare pods without a replication controller. The pods remain after the tasks complete, which gives you an opportunity to review the logs.
To see all pods for a specific task, use the following command:
kubectl get pod -l task-name=<task-name>
To review the task logs, use the following command:
kubectl logs <task-pod-name>
You have two options to delete completed pods. You can delete them manually once they are no longer needed or you can use the Data Flow shell
task execution cleanup
command to remove the completed pod for a task execution.
To delete the task pod manually, use the following command:
kubectl delete pod <task-pod-name>
To use the
task execution cleanup
command, you must first determine the
ID
for the task execution. To do so, use the
task execution list
command, as the following example (with output) shows:
dataflow:>task execution list
╔═════════╤══╤════════════════════════════╤════════════════════════════╤═════════╗
║Task Name│ID│ Start Time │ End Time │Exit Code║
╠═════════╪══╪════════════════════════════╪════════════════════════════╪═════════╣
║task1 │1 │Fri May 05 18:12:05 EDT 2017│Fri May 05 18:12:05 EDT 2017│0 ║
╚═════════╧══╧════════════════════════════╧════════════════════════════╧═════════╝
Once you have the ID, you can issue the command to cleanup the execution artifacts (the completed pod), as the following example shows:
dataflow:>task execution cleanup --id 1
Request to clean up resources for task execution 1 has been submitted
By default Spring Cloud Data Flow passes database credentials as properties to the pod at task launch time.
If using the
exec
or
shell
entry point styles the DB credentials will be viewable if the user does a
kubectl describe
on the task’s pod.
To configure Spring Cloud Data Flow to use Kubernetes Secrets: Set
spring.cloud.dataflow.task.use.kubernetes.secrets.for.db.credentials
property to
true
. If using the yaml files provided by Spring Cloud Data Flow update the `src/kubernetes/server/server-deployment.yaml to add the following environment variable:
- name: SPRING_CLOUD_DATAFLOW_TASK_USE_KUBERNETES_SECRETS_FOR_DB_CREDENTIALS
value: 'true'
If upgrading from a previous version of SCDF be sure to verify that
spring.datasource.username
and
spring.datasource.password
environment variables are present in the
secretKeyRefs
in the server-config.yaml. If not, add it as shown in the example below:
Also verify that the associated secret(dataKey) is also available in secrets. SCDF provides an example of this for MariaDB here:
src/kubernetes/mariadb/mariadb-svc.yaml
.
You should choose an Entry Point Style of either
exec
or
shell
, to correspond to how the
ENTRYPOINT
syntax is defined in the container’s
Dockerfile
. For more information and uses cases on
exec
vs
shell
, see the
ENTRYPOINT
section of the Docker documentation.
Using the
boot
Entry Point Style corresponds to using the
exec
style
ENTRYPOINT
. Command line arguments from the deployment request are passed to the container, with the addition of application properties mapped into the
SPRING_APPLICATION_JSON
environment variable rather than command line arguments.
When scheduling an application, You can clean up finished Jobs (either Complete or Failed) automatically by specifying
ttlSecondsAfterFinished
value.
The following example shows how you can individually configure application jobs:
Replace
<application>
with the name of your application and the
ttlSecondsAfterFinished
attribute with the appropriate value for clean up finished Jobs.
You can configure the
ttlSecondsAfterFinished
at the global server level as well.
The following example shows how to do so for tasks:
You can configure an image pull policy at the server level in the container
env
section of a deployment YAML, as the following example shows:
To influence the environment settings for a given application, you can take advantage of the
spring.cloud.deployer.kubernetes.environmentVariables
property.
For example, a common requirement in production settings is to influence the JVM memory arguments.
You can achieve this by using the
JAVA_TOOL_OPTIONS
environment variable, as the following example shows:
deployer.kubernetes.environmentVariables=JAVA_TOOL_OPTIONS=-Xmx1024m
When deploying stream applications or launching task applications where some of the properties may contain sensitive information, use the
shell
or
boot
as the
entryPointStyle
. This is because the
exec
(default) converts all properties to command line arguments and thus may not be secure in some environments.
Docker images that are private and require authentication can be pulled by configuring a Secret. First, you must create a Secret in the cluster. Follow the Pull an Image from a Private Registry guide to create the Secret.
Once you have created the secret, use the
imagePullSecret
property to set the secret to use, as the following example shows:
deployer.kubernetes.imagePullSecret=mysecret
Replace
mysecret
with the name of the secret you created earlier.
You can also configure the image pull secret at the server level in the container
env
section of a deployment YAML, as the following example shows:
Replace
mysecret
with the name of the secret you created earlier.
By default the namespace used for scheduled tasks is
default
. This value can be set at the server level configuration in the container
env
section of a deployment YAML, as the following example shows:
Replace
myserviceaccountname
with the service account name to be applied to all deployments.
For more information on scheduling tasks see Scheduling Tasks .
Debugging the Spring Cloud Data Flow Kubernetes Server and included components (such as the Spring Cloud Kubernetes Deployer ) is supported through the Java Debug Wire Protocol (JDWP) . This section outlines an approach to manually enable debugging and another approach that uses configuration files provided with Spring Cloud Data Flow Server Kubernetes to “patch” a running deployment.
To manually enable JDWP, first edit
src/kubernetes/server/server-deployment.yaml
and add an additional
containerPort
entry under
spec.template.spec.containers.ports
with a value of
5005
. Additionally, add the
JAVA_TOOL_OPTIONS
environment variable under
spec.template.spec.containers.env
as the following example shows:
spec:
template:
spec:
containers:
- name: scdf-server
ports:
- containerPort: 5005
- name: JAVA_TOOL_OPTIONS
value: '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005'
Environment:
JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
With the server started and JDWP enabled, you need to configure access to the port. In this example, we use the
port-forward
subcommand of
kubectl
. The following example (with output) shows how to expose a local port to your debug target by using
port-forward
:
$ kubectl get pod -l app=scdf-server
NAME READY STATUS RESTARTS AGE
scdf-server-5b7cfd86f7-d8mj4 1/1 Running 0 10m
$ kubectl port-forward scdf-server-5b7cfd86f7-d8mj4 5005:5005
Forwarding from 127.0.0.1:5005 -> 5005
Forwarding from [::1]:5005 -> 5005
You can now attach a debugger by pointing it to
127.0.0.1
as the host and
5005
as the port. The
port-forward
subcommand runs until stopped (by pressing
CTRL+c
, for example).
You can remove debugging support by reverting the changes to
src/kubernetes/server/server-deployment.yaml
. The reverted changes are picked up on the next deployment of the Spring Cloud Data Flow Kubernetes Server. Manually adding debug support to the configuration is useful when debugging should be enabled by default each time the server is deployed.
Rather than manually changing the
server-deployment.yaml
, Kubernetes objects can be “patched” in place. For convenience, patch files that provide the same configuration as the manual approach are included. To enable debugging by patching, use the following command:
kubectl patch deployment scdf-server -p "$(cat src/kubernetes/server/server-deployment-debug.yaml)"
Running the preceding command automatically adds the
containerPort
attribute and the
JAVA_TOOL_OPTIONS
environment variable. The following example (with output) shows how toverify changes to the
scdf-server
deployment:
$ kubectl describe deployment/scdf-server
Pod Template:
Containers:
scdf-server:
Ports: 5005/TCP, 80/TCP
Environment:
JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
To enable access to the debug port, rather than using the port-forward
subcommand of kubectl
, you can patch the scdf-server
Kubernetes service object. You must first ensure that the scdf-server
Kubernetes service object has the proper configuration. The following example (with output) shows how to do so:
kubectl describe service/scdf-server
Port: <unset> 80/TCP
TargetPort: 80/TCP
NodePort: <unset> 30784/TCP
If the output contains <unset>
, you must patch the service to add a name for this port. The following example shows how to do so:
$ kubectl patch service scdf-server -p "$(cat src/kubernetes/server/server-svc.yaml)"
Port: scdf-server-jdwp 5005/TCP
TargetPort: 5005/TCP
NodePort: scdf-server-jdwp 31339/TCP
Port: scdf-server 80/TCP
TargetPort: 80/TCP
NodePort: scdf-server 30883/TCP
The output shows that container port 5005 has been mapped to the NodePort of 31339. The following example (with output) shows how to get the IP address of the Minikube node:
$ minikube ip
192.168.99.100
With this information, you can create a debug connection by using a host of 192.168.99.100 and a port of 31339.
The following example shows how to disable JDWP:
$ kubectl rollout undo deployment/scdf-server
$ kubectl patch service scdf-server --type json -p='[{"op": "remove", "path": "/spec/ports/0"}]'
The Kubernetes deployment object is rolled back to its state before being patched. The Kubernetes service object is then patched with a remove
operation to remove port 5005 from the containerPorts
list.
This section covers the options for starting the shell and more advanced functionality relating to how the shell handles whitespace, quotes, and interpretation of SpEL expressions.
The introductory chapters to the
Stream DSL and Composed Task DSL are good places to start for the most common usage of shell commands.
The shell is built upon the Spring Shell project.
Some command-line options come from Spring Shell, and some are specific to Data Flow.
The shell takes the following command line options:
unix:>java -jar spring-cloud-dataflow-shell-2.11.0.jar --help
Data Flow Options:
--dataflow.uri= Address of the Data Flow Server [default: http://localhost:9393].
--dataflow.username= Username of the Data Flow Server [no default].
--dataflow.password= Password of the Data Flow Server [no default].
--dataflow.credentials-provider-command= Executes an external command which must return an
OAuth Bearer Token (Access Token prefixed with 'Bearer '),
e.g. 'Bearer 12345'), [no default].
--dataflow.skip-ssl-validation= Accept any SSL certificate (even self-signed) [default: no].
--dataflow.proxy.uri= Address of an optional proxy server to use [no default].
--dataflow.proxy.username= Username of the proxy server (if required by proxy server) [no default].
--dataflow.proxy.password= Password of the proxy server (if required by proxy server) [no default].
--spring.shell.historySize= Default size of the shell log file [default: 3000].
--spring.shell.commandFile= Data Flow Shell executes commands read from the file(s) and then exits.
--help This message.
You can use the spring.shell.commandFile
option to point to an existing file that contains
all the shell commands to deploy one or many related streams and tasks.
Running multiple files is also supported. They should be passed as a comma-delimited string:
--spring.shell.commandFile=file1.txt,file2.txt
This option is useful when creating some scripts to help automate deployment.
Also, the following shell command helps to modularize a complex script into multiple independent files:
dataflow:>script --file <YOUR_AWESOME_SCRIPT>
Typing help
at the command prompt gives a listing of all available commands.
Most of the commands are for Data Flow functionality, but a few are general purpose.
The following listing shows the output of the help
command:
Built-In Commands
help: Display help about available commands
stacktrace: Display the full stacktrace of the last error.
clear: Clear the shell screen.
quit, exit: Exit the shell.
history: Display or save the history of previously run commands
version: Show version info
script: Read and execute commands from a file.
SYNOPSIS
stream create [--name String] [--definition String] --description String --deploy boolean
OPTIONS
--name String
the name to give to the stream
[Mandatory]
--definition String
a stream definition, using the DSL (e.g. "http --port=9000 | hdfs")
[Mandatory]
--description String
a short description about the stream
[Optional]
--deploy boolean
whether to deploy the stream immediately
[Optional, default = false]
There is a Spring Shell-based client that talks to the Data Flow Server and is responsible for parsing the DSL. In turn, applications may have application properties that rely on embedded languages, such as the Spring Expression Language .
The Shell, Data Flow DSL parser, and SpEL have rules about how they handle quotes and how syntax escaping works. When combined together, confusion may arise. This section explains the rules that apply and provides examples of the most complicated situations you may encounter when all three components are involved.
A shell command is made of keys (
--something
) and corresponding values. There is a special, keyless mapping, though, which is described later.
A value cannot normally contain spaces, as space is the default delimiter for commands.
Spaces can be added though, by surrounding the value with quotes (either single (
'
) or double (
"
) quotes).
Values passed inside deployment properties (for example,
deployment <stream-name> --properties " …"
) should not be quoted again.
If surrounded with quotes, a value can embed a literal quote of the same kind by prefixing it with a backslash (
\
).
Other escapes are available, such as
\t
,
\n
,
\r
,
\f
and unicode escapes of the form
\uxxxx
.
The keyless mapping is handled in a special way such that it does not need quoting to contain spaces.
The argument here is the whole
rm something
string, which is passed as is to the underlying shell.
As another example, the following commands are strictly equivalent, and the argument value is
something
(without the quotes):
dataflow:>stream destroy something
dataflow:>stream destroy --name something
dataflow:>stream destroy "something"
dataflow:>stream destroy --name "something"
The special characters used in property files (both Java and YAML) need to be escaped. For example
\
should be replaced by
\\
,
\t
by
\\t
and so forth.
For Java property files (
--propertiesFile <FILE_PATH>.properties
), the property values should not be surrounded by quotes. It is not needed even if they contain spaces.
filter --expression=payload>5
filter --expression="payload>5"
filter --expression='payload>5'
filter --expression='payload > 5'
Arguably, the last one is more readable. It is made possible thanks to the surrounding quotes. The actual expression is
payload > 5
.
Now, imagine that we want to test against string messages. If we want to compare the payload to the SpEL literal string,
"something"
, we could use the following:
filter --expression=payload=='something' (1)
filter --expression='payload == ''something''' (2)
filter --expression='payload == "something"' (3)
This uses single quotes to protect the whole argument. Hence, the actual single quotes need to be doubled.
SpEL recognizes String literals with either single or double quotes, so this last method is arguably the most readable.
Note that the preceding examples are to be considered outside of the shell (for example, when calling the REST API directly). When entered inside the shell, chances are that the whole stream definition is itself inside double quotes, which would need to be escaped. The whole example then becomes the following:
dataflow:>stream create something --definition "http | filter --expression=payload='something' | log"
dataflow:>stream create something --definition "http | filter --expression='payload == ''something''' | log"
dataflow:>stream create something --definition "http | filter --expression='payload == \"something\"' | log"
The last piece of the puzzle is about SpEL expressions. Many applications accept options that are to be interpreted as SpEL expressions, and, as seen earlier, String literals are handled in a special way there, too. The rules are as follows:
As a last example, assume you want to use the
transform processor
.
This processor accepts an
expression
option which is a SpEL expression. It is to be evaluated against the incoming message, with a default of
payload
(which forwards the message payload untouched).
It is important to understand that the following statements are equivalent:
dataflow:>stream create something --definition "http | transform --expression='''hello world''' | log" (1) dataflow:>stream create something --definition "http | transform --expression='\"hello world\"' | log" (2) dataflow:>stream create something --definition "http | transform --expression=\"'hello world'\" | log" (2)In the first line, single quotes surround the string (at the Data Flow parser level), but they need to be doubled because they are inside a string literal (started by the first single quote after the equals sign). The second and third lines use single and double quotes, respectively, to encompass the whole string at the Data Flow parser level. Consequently, the other kind of quote can be used inside the string. The whole thing is inside the
--definition
argument to the shell, though, which uses double quotes. Consequently, double quotes are escaped (at the shell level).
This section goes into more detail about how you can create Streams, which are collections of Spring Cloud Stream applications. It covers topics such as creating and deploying Streams.
If you are just starting out with Spring Cloud Data Flow, you should probably read the Getting Started guide before diving into this section.
A Stream is a collection of long-lived Spring Cloud Stream applications that communicate with each other over messaging middleware. A text-based DSL defines the configuration and data flow between the applications. While many applications are provided for you to implement common use-cases, you typically create a custom Spring Cloud Stream application to implement custom business logic.
The general lifecycle of a Stream is:
For deploying Streams, the Data Flow Server has to be configured to delegate the deployment to a new server in the Spring Cloud ecosystem named Skipper .
Furthermore, you can configure Skipper to deploy applications to one or more Cloud Foundry orgs and spaces, one or more namespaces on a Kubernetes cluster, or to the local machine. When deploying a stream in Data Flow, you can specify which platform to use at deployment time. Skipper also provides Data Flow with the ability to perform updates to deployed streams. There are many ways the applications in a stream can be updated, but one of the most common examples is to upgrade a processor application with new custom business logic while leaving the existing source and sink applications alone.
A stream is defined by using a Unix-inspired
Pipeline syntax
.
The syntax uses vertical bars, known as “pipes”, to connect multiple commands.
The command
ls -l | grep key | less
in Unix takes the output of the
ls -l
process and pipes it to the input of the
grep key
process.
The output of
grep
is, in turn, sent to the input of the
less
process.
Each
|
symbol connects the standard output of the command on the left to the standard input of the command on the right.
Data flows through the pipeline from left to right.
In Data Flow, the Unix command is replaced by a Spring Cloud Stream application and each pipe symbol represents connecting the input and output of applications over messaging middleware, such as RabbitMQ or Apache Kafka.
Each Spring Cloud Stream application is registered under a simple name. The registration process specifies where the application can be obtained (for example, in a Maven Repository or a Docker registry). In Data Flow, we classify the Spring Cloud Stream applications as Sources, Processors, or Sinks.
As a simple example, consider the collection of data from an HTTP Source and writing to a File Sink. Using the DSL, the stream description is:
http | file
A stream that involves some processing would be expressed as:
http | filter | transform | file
Stream definitions can be created by using the shell’s
stream create
command, as shown in the following example:
dataflow:> stream create --name httpIngest --definition "http | file"
The Stream DSL is passed in to the
--definition
command option.
The deployment of stream definitions is done through the Shell’s
stream deploy
command, as follows:
dataflow:> stream deploy --name ticktock
The Getting Started section shows you how to start the server and how to start and use the Spring Cloud Data Flow shell.
Note that the shell calls the Data Flow Server’s REST API. For more information on making HTTP requests directly to the server, see the REST API Guide .
You can use the Stream Application DSL to define custom binding properties for each of the Spring Cloud Stream applications. See the Stream Application DSL section of the microsite for more information.
Each application takes properties to customize its behavior. As an example, the
http
source module exposes a
port
setting that lets the data ingestion port be changed from the default value:
This
port
property is actually the same as the standard Spring Boot
server.port
property.
Data Flow adds the ability to use the shorthand form
port
instead of
server.port
.
You can also specify the longhand version:
This shorthand behavior is discussed more in the section on
Stream Application Properties
.
If you have
registered application property metadata
, you can use tab completion in the shell after typing
--
to get a list of candidate property names.
The shell provides tab completion for application properties. The
app info --name <appName> --type <appType>
shell command provides additional documentation for all the supported properties.
Skipper is a server that lets you discover Spring Boot applications and manage their lifecycle on multiple cloud platforms.
Applications in Skipper are bundled as packages that contain the application’s resource location, application properties, and deployment properties.
You can think of Skipper packages as being analogous to packages found in tools such as
apt-get
or
brew
.
When Data Flow deploys a Stream, it generates and upload a package to Skipper that represents the applications in the Stream. Subsequent commands to upgrade or roll back the applications within the Stream are passed through to Skipper. In addition, the Stream definition is reverse-engineered from the package, and the status of the Stream is also delegated to Skipper.
You can register a versioned stream application by using the
app register
command. You must provide a unique name, an application type, and a URI that can be resolved to the application artifact.
For the type, specify
source
,
processor
, or
sink
. The version is resolved from the URI. Here are a few examples:
dataflow:>app register --name mysource --type source --uri maven://com.example:mysource:0.0.1
dataflow:>app register --name mysource --type source --uri maven://com.example:mysource:0.0.2
dataflow:>app register --name mysource --type source --uri maven://com.example:mysource:0.0.3
dataflow:>app list --id source:mysource
╔═══╤══════════════════╤═════════╤════╤════╗
║app│ source │processor│sink│task║
╠═══╪══════════════════╪═════════╪════╪════╣
║ │> mysource-0.0.1 <│ │ │ ║
║ │mysource-0.0.2 │ │ │ ║
║ │mysource-0.0.3 │ │ │ ║
╚═══╧══════════════════╧═════════╧════╧════╝
dataflow:>app register --name myprocessor --type processor --uri file:///Users/example/myprocessor-1.2.3.jar
dataflow:>app register --name mysink --type sink --uri https://example.com/mysink-2.0.1.jar
dataflow:>app register --name http --type source --uri maven://org.springframework.cloud.stream.app:http-source-rabbit:3.2.1
dataflow:>app register --name log --type sink --uri maven://org.springframework.cloud.stream.app:log-sink-rabbit:3.2.1
If you would like to register multiple applications at one time, you can store them in a properties file, where the keys are formatted as
<type>.<name>
and the values are the URIs.
For example, to register the snapshot versions of the
http
and
log
applications built with the RabbitMQ binder, you could have the following in a properties file (for example,
stream-apps.properties
):
Registering an application by using
--type app
is the same as registering a
source
,
processor
or
sink
.
Applications of the type
app
can be used only in the Stream Application DSL (which uses double pipes
||
instead of single pipes
|
in the DSL) and instructs Data Flow not to configure the Spring Cloud Stream binding properties of the application.
The application that is registered using
--type app
does not have to be a Spring Cloud Stream application. It can be any Spring Boot application.
See the
Stream Application DSL introduction
for more about using this application type.
You can register multiple versions of the same applications (for example, the same name and type), but you can set only one as the default. The default version is used for deploying Streams.
The first time an application is registered, it is marked as default. The default application version can be altered with the
app default
command:
dataflow:>app default --id source:mysource --version 0.0.2
dataflow:>app list --id source:mysource
╔═══╤══════════════════╤═════════╤════╤════╗
║app│ source │processor│sink│task║
╠═══╪══════════════════╪═════════╪════╪════╣
║ │mysource-0.0.1 │ │ │ ║
║ │> mysource-0.0.2 <│ │ │ ║
║ │mysource-0.0.3 │ │ │ ║
╚═══╧══════════════════╧═════════╧════╧════╝
dataflow:>app unregister --name mysource --type source --version 0.0.1
dataflow:>app list --id source:mysource
╔═══╤══════════════════╤═════════╤════╤════╗
║app│ source │processor│sink│task║
╠═══╪══════════════════╪═════════╪════╪════╣
║ │> mysource-0.0.2 <│ │ │ ║
║ │mysource-0.0.3 │ │ │ ║
╚═══╧══════════════════╧═════════╧════╧════╝
All applications in a stream should have a default version set for the stream to be deployed.
Otherwise, they are treated as unregistered application during the deployment.
Use the
app default
command to set the defaults.
app default --id source:mysource --version 0.0.3
dataflow:>app list --id source:mysource
╔═══╤══════════════════╤═════════╤════╤════╗
║app│ source │processor│sink│task║
╠═══╪══════════════════╪═════════╪════╪════╣
║ │mysource-0.0.2 │ │ │ ║
║ │> mysource-0.0.3 <│ │ │ ║
╚═══╧══════════════════╧═════════╧════╧════╝
The
stream deploy
necessitates default application versions being set.
The
stream update
and
stream rollback
commands, though, can use all (default and non-default) registered application versions.
The following command creates a stream that uses the default mysource version (0.0.3):
For convenience, we have the static files with application-URIs (for both Maven and Docker) available for all the out-of-the-box stream and task applications. You can point to this file and import all the application-URIs in bulk. Otherwise, as explained previously, you can register them individually or have your own custom property file with only the required application-URIs in it. We recommend, however, having a “focused” list of desired application-URIs in a custom property file.
The following table includes the
dataflow.spring.io
links to the stream applications based on Spring Cloud Stream
3.2.x
and Spring Boot
2.7.x
.
RabbitMQ + Maven
dataflow.spring.io/rabbitmq-maven-latest
dataflow.spring.io/rabbitmq-maven-latest-snapshot
RabbitMQ + Docker
dataflow.spring.io/rabbitmq-docker-latest
dataflow.spring.io/rabbitmq-docker-latest-snapshot
Apache Kafka + Maven
dataflow.spring.io/kafka-maven-latest
dataflow.spring.io/kafka-maven-latest-snapshot
Apache Kafka + Docker
dataflow.spring.io/kafka-docker-latest
dataflow.spring.io/kafka-docker-latest-snapshot
For more information about the available out-of-the-box stream applications see the Spring Cloud Stream Applications project page.
For more information about the available out-of-the-box task applications see timestamp-task and timestamp-batch docs.
As an example, if you would like to register all out-of-the-box stream applications built with the Kafka binder in bulk, you can use the following command:
You can also pass the
--local
option (which is
true
by default) to indicate whether the
properties file location should be resolved within the shell process itself. If the location should
be resolved from the Data Flow Server process, specify
--local false
.
When you use either
app register
or
app import
, if an application is already registered with
the provided name and type and version, it is, by default, not overridden. If you would like to override the
pre-existing application
uri
or
metadata-uri
coordinates, include the
--force
option.
Note, however, that, once downloaded, applications may be cached locally on the Data Flow server, based on the resource
location. If the resource location does not change (even though the actual resource
bytes
may be different), it
is not re-downloaded. When using
maven://
resources, on the other hand, using a constant location may still circumvent
caching (if using
-SNAPSHOT
versions).
Moreover, if a stream is already deployed and uses some version of a registered app, then (forcibly) re-registering a different application has no effect until the stream is deployed again.
In some cases, the resource is resolved on the server side. In others, the URI is passed to a runtime container instance, where it is resolved. See the specific documentation of each Data Flow Server for more detail.While Data Flow includes source, processor, sink applications, you can extend these applications or write a custom Spring Cloud Stream application. You can follow the Stream Development guide on the Microsite to create your own custom application. Once you have created a custom application, you can register it, as described in Register a Stream Application .
The Spring Cloud Data Flow Server exposes a full RESTful API for managing the lifecycle of stream definitions, but the easiest way to use is it is through the Spring Cloud Data Flow shell. The Getting Started section describes how to start the shell.
New streams are created with the help of stream definitions. The definitions are built from a simple DSL. For example, consider what happens if we run the following shell command:
This defines a stream named
ticktock
that is based off of the DSL expression
time | log
. The DSL uses the “pipe” symbol (
|
), to connect a source to a sink.
The
stream info
command shows useful information about the stream, as shown (with its output) in the following example:
dataflow:>stream info ticktock
╔═══════════╤═════════════════╤═══════════╤══════════╗
║Stream Name│Stream Definition│Description│ Status ║
╠═══════════╪═════════════════╪═══════════╪══════════╣
║ticktock │time | log │ │undeployed║
╚═══════════╧═════════════════╧═══════════╧══════════╝
Application properties are the properties associated with each application in the stream. When the application is deployed, the application properties are applied to the application through command-line arguments or environment variables, depending on the underlying deployment implementation.
The following stream can have application properties defined at the time of stream creation:
The
app info --name <appName> --type <appType>
shell command displays the exposed application properties for the application.
For more about exposed properties, see
Application Metadata
.
The following listing shows the exposed properties for the
time
application:
dataflow:> app info --name time --type source
Information about source application 'time':
Version: '3.2.1':
Default application version: 'true':
Resource URI: maven://org.springframework.cloud.stream.app:time-source-rabbit:3.2.1
╔══════════════════════════════╤══════════════════════════════╤══════════════════════════════╤══════════════════════════════╗
║ Option Name │ Description │ Default │ Type ║
╠══════════════════════════════╪══════════════════════════════╪══════════════════════════════╪══════════════════════════════╣
║spring.integration.poller.max-│Maximum number of messages to │<none> │java.lang.Integer ║
║messages-per-poll │poll per polling cycle. │ │ ║
║spring.integration.poller.fixe│Polling rate period. Mutually │<none> │java.time.Duration ║
║d-rate │exclusive with 'fixedDelay' │ │ ║
║ │and 'cron'. │ │ ║
║spring.integration.poller.fixe│Polling delay period. Mutually│<none> │java.time.Duration ║
║d-delay │exclusive with 'cron' and │ │ ║
║ │'fixedRate'. │ │ ║
║spring.integration.poller.rece│How long to wait for messages │1s │java.time.Duration ║
║ive-timeout │on poll. │ │ ║
║spring.integration.poller.cron│Cron expression for polling. │<none> │java.lang.String ║
║ │Mutually exclusive with │ │ ║
║ │'fixedDelay' and 'fixedRate'. │ │ ║
║spring.integration.poller.init│Polling initial delay. Applied│<none> │java.time.Duration ║
║ial-delay │for 'fixedDelay' and │ │ ║
║ │'fixedRate'; ignored for │ │ ║
║ │'cron'. │ │ ║
║time.date-format │Format for the date value. │MM/dd/yy HH:mm:ss │java.lang.String ║
╚══════════════════════════════╧══════════════════════════════╧══════════════════════════════╧══════════════════════════════╝
dataflow:> app info --name log --type sink
Information about sink application 'log':
Version: '3.2.1':
Default application version: 'true':
Resource URI: maven://org.springframework.cloud.stream.app:log-sink-rabbit:3.2.1
╔══════════════════════════════╤══════════════════════════════╤══════════════════════════════╤══════════════════════════════╗
║ Option Name │ Description │ Default │ Type ║
╠══════════════════════════════╪══════════════════════════════╪══════════════════════════════╪══════════════════════════════╣
║log.name │The name of the logger to use.│<none> │java.lang.String ║
║log.level │The level at which to log │<none> │org.springframework.integratio║
║ │messages. │ │n.handler.LoggingHandler$Level║
║log.expression │A SpEL expression (against the│payload │java.lang.String ║
║ │incoming message) to evaluate │ │ ║
║ │as the logged message. │ │ ║
╚══════════════════════════════╧══════════════════════════════╧══════════════════════════════╧══════════════════════════════╝
Note that, in the preceding example, the
fixed-delay
and
level
properties defined for the
time
and
log
applications are the “short-form” property names provided by the shell completion.
These “short-form” property names are applicable only for the exposed properties. In all other cases, you should use only fully qualified property names.
In addition to configuration through DSL, Spring Cloud Data Flow provides a mechanism for setting common properties to all
the streaming applications that are launched by it.
This can be done by adding properties prefixed with
spring.cloud.dataflow.applicationProperties.stream
when starting
the server.
When doing so, the server passes all the properties, without the prefix, to the instances it launches.
For example, all the launched applications can be configured to use a specific Kafka broker by launching the Data Flow server with the following options:
--spring.cloud.dataflow.applicationProperties.stream.spring.cloud.stream.kafka.binder.brokers=192.168.1.100:9092
--spring.cloud.dataflow.applicationProperties.stream.spring.cloud.stream.kafka.binder.zkNodes=192.168.1.100:2181
Doing so causes the
spring.cloud.stream.kafka.binder.brokers
and
spring.cloud.stream.kafka.binder.zkNodes
properties
to be passed to all the launched applications.
app.http.spring.cloud.stream.kafka.binder.brokers
overrides the common property).
This section describes how to deploy a Stream when the Spring Cloud Data Flow server is responsible for deploying the stream. It covers the deployment and upgrade of Streams by using the Skipper service. The description of how to set deployment properties applies to both approaches of Stream deployment.
Consider the
ticktock
stream definition:
The Data Flow Server delegates to Skipper the resolution and deployment of the
time
and
log
applications.
The
stream info
command shows useful information about the stream, including the deployment properties:
dataflow:>stream info --name ticktock
╔═══════════╤═════════════════╤═════════╗
║Stream Name│Stream Definition│ Status ║
╠═══════════╪═════════════════╪═════════╣
║ticktock │time | log │deploying║
╚═══════════╧═════════════════╧═════════╝
Stream Deployment properties: {
"log" : {
"resource" : "maven://org.springframework.cloud.stream.app:log-sink-rabbit",
"spring.cloud.deployer.group" : "ticktock",
"version" : "2.0.1.RELEASE"
"time" : {
"resource" : "maven://org.springframework.cloud.stream.app:time-source-rabbit",
"spring.cloud.deployer.group" : "ticktock",
"version" : "2.0.1.RELEASE"
There is an important optional command argument (called --platformName
) to the stream deploy
command.
Skipper can be configured to deploy to multiple platforms.
Skipper is pre-configured with a platform named default
, which deploys applications to the local machine where Skipper is running.
The default value of the --platformName
command line argument is default
.
If you commonly deploy to one platform, when installing Skipper, you can override the configuration of the default
platform.
Otherwise, specify the platformName
to be one of the values returned by the stream platform-list
command.
In the preceding example, the time source sends the current time as a message each second, and the log sink outputs it by using the logging framework.
You can tail the stdout
log (which has an <instance>
suffix). The log files are located within the directory displayed in the Data Flow Server’s log output, as shown in the following listing:
$ tail -f /var/folders/wn/8jxm_tbd1vj28c8vj37n900m0000gn/T/spring-cloud-dataflow-912434582726479179/ticktock-1464788481708/ticktock.log/stdout_0.log
2016-06-01 09:45:11.250 INFO 79194 --- [ kafka-binder-] log.sink : 06/01/16 09:45:11
2016-06-01 09:45:12.250 INFO 79194 --- [ kafka-binder-] log.sink : 06/01/16 09:45:12
2016-06-01 09:45:13.251 INFO 79194 --- [ kafka-binder-] log.sink : 06/01/16 09:45:13
However, it is not common in real-world use cases to create and deploy the stream in one step.
The reason is that when you use the stream deploy
command, you can pass in properties that define how to map the applications onto the platform (for example, what is the memory size of the container to use, the number of each application to run, and whether to enable data partitioning features).
Properties can also override application properties that were set when creating the stream.
The next sections cover this feature in detail.
17.3.1. Deployment Properties
When deploying a stream, you can specify properties that can control how applications are deployed and configured. See the Deployment Properties section of the microsite for more information.
17.6. Validating a Stream
Sometimes, an application contained within a stream definition contains an invalid URI in its registration.
This can caused by an invalid URI being entered at application registration time or by the application being removed from the repository from which it was to be drawn.
To verify that all the applications contained in a stream are resolve-able, a user can use the validate
command:
dataflow:>stream validate ticktock
╔═══════════╤═════════════════╗
║Stream Name│Stream Definition║
╠═══════════╪═════════════════╣
║ticktock │time | log ║
╚═══════════╧═════════════════╝
ticktock is a valid stream.
╔═══════════╤═════════════════╗
║ App Name │Validation Status║
╠═══════════╪═════════════════╣
║source:time│valid ║
║sink:log │valid ║
╚═══════════╧═════════════════╝
In the preceding example, the user validated their ticktock stream. Both the source:time
and sink:log
are valid.
Now we can see what happens if we have a stream definition with a registered application with an invalid URI:
dataflow:>stream validate bad-ticktock
╔════════════╤═════════════════╗
║Stream Name │Stream Definition║
╠════════════╪═════════════════╣
║bad-ticktock│bad-time | log ║
╚════════════╧═════════════════╝
bad-ticktock is an invalid stream.
╔═══════════════╤═════════════════╗
║ App Name │Validation Status║
╠═══════════════╪═════════════════╣
║source:bad-time│invalid ║
║sink:log │valid ║
╚═══════════════╧═════════════════╝
17.7. Updating a Stream
To update the stream, use the stream update
command, which takes either --properties
or --propertiesFile
as a command argument.
Skipper has an important new top-level prefix: version
.
The following commands deploy http | log
stream (and the version of log
which registered at the time of deployment was 3.2.0
):
dataflow:> stream create --name httptest --definition "http --server.port=9000 | log"
dataflow:> stream deploy --name httptest
dataflow:>stream info httptest
╔══════════════════════════════╤══════════════════════════════╤════════════════════════════╗
║ Name │ DSL │ Status ║
╠══════════════════════════════╪══════════════════════════════╪════════════════════════════╣
║httptest │http --server.port=9000 | log │deploying ║
╚══════════════════════════════╧══════════════════════════════╧════════════════════════════╝
Stream Deployment properties: {
"log" : {
"spring.cloud.deployer.indexed" : "true",
"spring.cloud.deployer.group" : "httptest",
"maven://org.springframework.cloud.stream.app:log-sink-rabbit" : "3.2.0"
"http" : {
"spring.cloud.deployer.group" : "httptest",
"maven://org.springframework.cloud.stream.app:http-source-rabbit" : "3.2.0"
Then the following command updates the stream to use the 3.2.1
version of the log application.
Before updating the stream with the specific version of the application, we need to make sure that the application is registered with that version:
dataflow:>app register --name log --type sink --uri maven://org.springframework.cloud.stream.app:log-sink-rabbit:3.2.1
Successfully registered application 'sink:log'
dataflow:>stream info httptest
╔══════════════════════════════╤══════════════════════════════╤════════════════════════════╗
║ Name │ DSL │ Status ║
╠══════════════════════════════╪══════════════════════════════╪════════════════════════════╣
║httptest │http --server.port=9000 | log │deploying ║
╚══════════════════════════════╧══════════════════════════════╧════════════════════════════╝
Stream Deployment properties: {
"log" : {
"spring.cloud.deployer.indexed" : "true",
"spring.cloud.deployer.count" : "1",
"spring.cloud.deployer.group" : "httptest",
"maven://org.springframework.cloud.stream.app:log-sink-rabbit" : "3.2.1"
"http" : {
"spring.cloud.deployer.group" : "httptest",
"maven://org.springframework.cloud.stream.app:http-source-rabbit" : "3.2.1"
17.8. Forcing an Update of a Stream
When upgrading a stream, you can use the --force
option to deploy new instances of currently deployed applications even if no application or deployment properties have changed.
This behavior is needed for when configuration information is obtained by the application itself at startup time — for example, from Spring Cloud Config Server.
You can specify the applications for which to force an upgrade by using the --app-names
option.
If you do not specify any application names, all the applications are forced to upgrade.
You can specify the --force
and --app-names
options together with the --properties
or --propertiesFile
options.
17.9. Stream Versions
Skipper keeps a history of the streams that were deployed.
After updating a Stream, there is a second version of the stream.
You can query for the history of the versions by using the stream history --name <name-of-stream>
command:
dataflow:>stream history --name httptest
╔═══════╤════════════════════════════╤════════╤════════════╤═══════════════╤════════════════╗
║Version│ Last updated │ Status │Package Name│Package Version│ Description ║
╠═══════╪════════════════════════════╪════════╪════════════╪═══════════════╪════════════════╣
║2 │Mon Nov 27 22:41:16 EST 2017│DEPLOYED│httptest │1.0.0 │Upgrade complete║
║1 │Mon Nov 27 22:40:41 EST 2017│DELETED │httptest │1.0.0 │Delete complete ║
╚═══════╧════════════════════════════╧════════╧════════════╧═══════════════╧════════════════╝
17.10. Stream Manifests
Skipper keeps a “manifest” of the all of the applications, their application properties, and their deployment properties after all values have been substituted.
This represents the final state of what was deployed to the platform.
You can view the manifest for any of the versions of a Stream by using the following command:
spec:
resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit
version: 3.2.0
applicationProperties:
spring.cloud.dataflow.stream.app.label: log
spring.cloud.stream.bindings.input.group: httptest
spring.cloud.dataflow.stream.name: httptest
spring.cloud.dataflow.stream.app.type: sink
spring.cloud.stream.bindings.input.destination: httptest.http
deploymentProperties:
spring.cloud.deployer.indexed: true
spring.cloud.deployer.group: httptest
spring.cloud.deployer.count: 1
# Source: http.yml
apiVersion: skipper.spring.io/v1
kind: SpringCloudDeployerApplication
metadata:
name: http
spec:
resource: maven://org.springframework.cloud.stream.app:http-source-rabbit
version: 3.2.0
applicationProperties:
spring.cloud.dataflow.stream.app.label: http
spring.cloud.stream.bindings.output.producer.requiredGroups: httptest
server.port: 9000
spring.cloud.stream.bindings.output.destination: httptest.http
spring.cloud.dataflow.stream.name: httptest
spring.cloud.dataflow.stream.app.type: source
deploymentProperties:
spring.cloud.deployer.group: httptest
17.13. Skipper’s Upgrade Strategy
Skipper has a simple “red/black” upgrade strategy. It deploys the new version of the applications, using as many instances as the currently running version, and checks the /health
endpoint of the application.
If the health of the new application is good, the previous application is undeployed.
If the health of the new application is bad, all new applications are undeployed, and the upgrade is considered to be not successful.
The upgrade strategy is not a rolling upgrade, so, if five instances of the application are running, then, in a sunny-day scenario, five of the new applications are also running before the older version is undeployed.
This section covers additional features of the Stream DSL not covered in the Stream DSL introduction.
18.1. Tap a Stream
Taps can be created at various producer endpoints in a stream. See the Tapping a Stream section of the microsite for more information.
18.2. Using Labels in a Stream
When a stream is made up of multiple applications with the same name, they must be qualified with labels.
See the Labeling Applications section of the microsite for more information.
18.3. Named Destinations
Instead of referencing a source or sink application, you can use a named destination.
See the Named Destinations section of the microsite for more information.
18.4. Fan-in and Fan-out
By using named destinations, you can support fan-in and fan-out use cases.
See the Fan-in and Fan-out section of the microsite for more information.
Instead of using the shell to create and deploy streams, you can use the Java-based DSL provided by the spring-cloud-dataflow-rest-client
module.
See the Java DSL section of the microsite for more information.
In some cases, a stream can have its applications bound to multiple spring cloud stream binders when they are required to connect to different messaging
middleware configurations. In those cases, you should make sure the applications are configured appropriately with their binder
configurations. For example, a multi-binder transformer that supports both Kafka and Rabbit binders is the processor in the following stream:
The Multi-Binder Transform processor receives events from RabbitMQ (rabbit1
) and sends the processed events into Kafka (kafka1
).
The log sink receives events from Kafka (kafka1
).
Here, rabbit1
and kafka1
are the binder names given in the Spring Cloud Stream application properties.
Based on this setup, the applications have the following binders in their classpaths with the appropriate configuration:
The spring-cloud-stream
binder
configuration properties can be set within the applications themselves.
If not, they can be passed through deployment
properties when the stream is deployed:
dataflow:>stream create --definition "http | multibindertransform --expression=payload.toUpperCase() | log" --name mystream
dataflow:>stream deploy mystream --properties "app.http.spring.cloud.stream.bindings.output.binder=rabbit1,app.multibindertransform.spring.cloud.stream.bindings.input.binder=rabbit1,
app.multibindertransform.spring.cloud.stream.bindings.output.binder=kafka1,app.log.spring.cloud.stream.bindings.input.binder=kafka1"
With Spring Cloud Stream 3.x adding functional support, you can build Source
, Sink
and Processor
applications merely by implementing the Java Util’s Supplier
, Consumer
, and Function
interfaces respectively.
See the Functional Application Recipe of the SCDF site for more about this feature.
dataflow:>stream create --name words --definition "http --server.port=9900 | splitter --expression=payload.split(' ') | log"
Created new stream 'words'
dataflow:>stream deploy words --properties "app.splitter.producer.partitionKeyExpression=payload,deployer.log.count=2"
Deployed stream 'words'
dataflow:>http post --target http://localhost:9900 --data "How much wood would a woodchuck chuck if a woodchuck could chuck wood"
> POST (text/plain;Charset=UTF-8) http://localhost:9900 How much wood would a woodchuck chuck if a woodchuck could chuck wood
> 202 ACCEPTED
dataflow:>runtime apps
╔════════════════════╤═══════════╤═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║App Id / Instance Id│Unit Status│ No. of Instances / Attributes ║
╠════════════════════╪═══════════╪═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╣
║words.log-v1 │ deployed │ 2 ║
╟┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╢
║ │ │ guid = 24166 ║
║ │ │ pid = 33097 ║
║ │ │ port = 24166 ║
║words.log-v1-0 │ deployed │ stderr = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/words-1542803461063/words.log-v1/stderr_0.log ║
║ │ │ stdout = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/words-1542803461063/words.log-v1/stdout_0.log ║
║ │ │ url = https://192.168.0.102:24166 ║
║ │ │working.dir = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/words-1542803461063/words.log-v1 ║
╟┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╢
║ │ │ guid = 41269 ║
║ │ │ pid = 33098 ║
║ │ │ port = 41269 ║
║words.log-v1-1 │ deployed │ stderr = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/words-1542803461063/words.log-v1/stderr_1.log ║
║ │ │ stdout = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/words-1542803461063/words.log-v1/stdout_1.log ║
║ │ │ url = https://192.168.0.102:41269 ║
║ │ │working.dir = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/words-1542803461063/words.log-v1 ║
╟────────────────────┼───────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║words.http-v1 │ deployed │ 1 ║
╟┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╢
║ │ │ guid = 9900 ║
║ │ │ pid = 33094 ║
║ │ │ port = 9900 ║
║words.http-v1-0 │ deployed │ stderr = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/words-1542803461054/words.http-v1/stderr_0.log ║
║ │ │ stdout = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/words-1542803461054/words.http-v1/stdout_0.log ║
║ │ │ url = https://192.168.0.102:9900 ║
║ │ │working.dir = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/words-1542803461054/words.http-v1 ║
╟────────────────────┼───────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║words.splitter-v1 │ deployed │ 1 ║
╟┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╢
║ │ │ guid = 33963 ║
║ │ │ pid = 33093 ║
║ │ │ port = 33963 ║
║words.splitter-v1-0 │ deployed │ stderr = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/words-1542803437542/words.splitter-v1/stderr_0.log║
║ │ │ stdout = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/words-1542803437542/words.splitter-v1/stdout_0.log║
║ │ │ url = https://192.168.0.102:33963 ║
║ │ │working.dir = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/words-1542803437542/words.splitter-v1 ║
╚════════════════════╧═══════════╧═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
2016-06-05 18:35:47.047 INFO 58638 --- [ kafka-binder-] log.sink : How
2016-06-05 18:35:47.066 INFO 58638 --- [ kafka-binder-] log.sink : chuck
2016-06-05 18:35:47.066 INFO 58638 --- [ kafka-binder-] log.sink : chuck
2016-06-05 18:35:47.047 INFO 58639 --- [ kafka-binder-] log.sink : much
2016-06-05 18:35:47.066 INFO 58639 --- [ kafka-binder-] log.sink : wood
2016-06-05 18:35:47.066 INFO 58639 --- [ kafka-binder-] log.sink : would
2016-06-05 18:35:47.066 INFO 58639 --- [ kafka-binder-] log.sink : a
2016-06-05 18:35:47.066 INFO 58639 --- [ kafka-binder-] log.sink : woodchuck
2016-06-05 18:35:47.067 INFO 58639 --- [ kafka-binder-] log.sink : if
2016-06-05 18:35:47.067 INFO 58639 --- [ kafka-binder-] log.sink : a
2016-06-05 18:35:47.067 INFO 58639 --- [ kafka-binder-] log.sink : woodchuck
2016-06-05 18:35:47.067 INFO 58639 --- [ kafka-binder-] log.sink : could
2016-06-05 18:35:47.067 INFO 58639 --- [ kafka-binder-] log.sink : wood
23.3. Other Source and Sink Application Types
This example shows something a bit more complicated: swapping out the time
source for something else. Another supported source type is http
, which accepts data for ingestion over HTTP POST requests. Note that the http
source accepts data on a different port from the Data Flow Server (default 8080). By default, the port is randomly assigned.
To create a stream that uses an http
source but still uses the same log
sink, we would change the original command in the Simple Stream Processing example to the following:
dataflow:>runtime apps
╔══════════════════════╤═══════════╤═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║ App Id / Instance Id │Unit Status│ No. of Instances / Attributes ║
╠══════════════════════╪═══════════╪═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╣
║myhttpstream.log-v1 │ deploying │ 1 ║
╟┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╢
║ │ │ guid = 39628 ║
║ │ │ pid = 34403 ║
║ │ │ port = 39628 ║
║myhttpstream.log-v1-0 │ deploying │ stderr = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/myhttpstream-1542803867070/myhttpstream.log-v1/stderr_0.log ║
║ │ │ stdout = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/myhttpstream-1542803867070/myhttpstream.log-v1/stdout_0.log ║
║ │ │ url = https://192.168.0.102:39628 ║
║ │ │working.dir = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/myhttpstream-1542803867070/myhttpstream.log-v1 ║
╟──────────────────────┼───────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║myhttpstream.http-v1 │ deploying │ 1 ║
╟┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╢
║ │ │ guid = 52143 ║
║ │ │ pid = 34401 ║
║ │ │ port = 52143 ║
║myhttpstream.http-v1-0│ deploying │ stderr = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/myhttpstream-1542803866800/myhttpstream.http-v1/stderr_0.log║
║ │ │ stdout = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/myhttpstream-1542803866800/myhttpstream.http-v1/stdout_0.log║
║ │ │ url = https://192.168.0.102:52143 ║
║ │ │working.dir = /var/folders/js/7b_pn0t575l790x7j61slyxc0000gn/T/spring-cloud-deployer-6467595568759190742/myhttpstream-1542803866800/myhttpstream.http-v1 ║
╚══════════════════════╧═══════════╧═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
See the Stream Developer Guides on the microsite for more about how to create, test, and run Spring Cloud Stream applications on your local machine.
Stream Monitoring
See the Stream Monitoring Guide on the microsite for more about how to monitor the applications that were deployed as part of a Stream.
Tasks
This section goes into more detail about how you can orchestrate Spring Cloud Task applications on Spring Cloud Data Flow.
If you are just starting out with Spring Cloud Data Flow, you should probably read the Getting Started guide for “Local” , “Cloud Foundry”, or “Kubernetes” before diving into this section.
A task application is short-lived, meaning that it stops running on purpose and can be run on demand or scheduled for later.
One use case might be to scrape a web page and write to the database.
The Spring Cloud Task framework is based on Spring Boot and adds the ability for Boot applications to record the lifecycle events of a short-lived application, such as when it starts, when it ends, and the exit status.
The TaskExecution
documentation shows which information is stored in the database.
The entry point for code execution in a Spring Cloud Task application is most often an implementation of Boot’s CommandLineRunner
interface, as shown in this example.
The Spring Batch project is probably what comes to mind for Spring developers writing short-lived applications.
Spring Batch provides a much richer set of functionality than Spring Cloud Task and is recommended when processing large volumes of data.
One use case might be to read many CSV files, transform each row of data, and write each transformed row to a database.
Spring Batch provides its own database schema with a much more rich set of information about the execution of a Spring Batch job.
Spring Cloud Task is integrated with Spring Batch so that, if a Spring Cloud Task application defines a Spring Batch Job
, a link between the Spring Cloud Task and Spring Cloud Batch execution tables is created.
When running Data Flow on your local machine, Tasks are launched in a separate JVM.
When running on Cloud Foundry, tasks are launched by using Cloud Foundry’s Task functionality. When running on Kubernetes, tasks are launched by using either a Pod
or a Job
resource.
25.1. Creating a Task Application
Spring Cloud Dataflow provides a couple of out-of-the-box task applications (timestamp-task and timestamp-batch) but most task applications require custom development.
To create a custom task application:
With this class, you need one or more CommandLineRunner
or ApplicationRunner
implementations within your application. You can either implement your own or use the ones provided by Spring Boot (there is one for running batch jobs, for example).
Packaging your application with Spring Boot into an über jar is done through the standard Spring Boot conventions.
The packaged application can be registered and deployed as noted below.
When launching a task application, be sure that the database driver that is being used by Spring Cloud Data Flow is also a dependency on the task application.
For example, if your Spring Cloud Data Flow is set to use Postgresql, be sure that the task application also has Postgresql as a dependency.
When you run tasks externally (that is, from the command line) and you want Spring Cloud Data Flow to show the TaskExecutions in its UI, be sure that common datasource settings are shared among them both.
By default, Spring Cloud Task uses a local H2 instance, and the execution is recorded to the database used by Spring Cloud Data Flow.
25.2. Registering a Task Application
You can register a Task application with the App Registry by using the Spring Cloud Data Flow Shell app register
command.
You must provide a unique name and a URI that can be resolved to the application artifact. For the type, specify task
.
The following listing shows three examples:
dataflow:>app register --name task1 --type task --uri maven://com.example:mytask:1.0.2
dataflow:>app register --name task2 --type task --uri file:///Users/example/mytask-1.0.2.jar
dataflow:>app register --name task3 --type task --uri https://example.com/mytask-1.0.2.jar
If you would like to register multiple applications at one time, you can store them in a properties file where the keys are formatted as <type>.<name>
and the values are the URIs.
For example, the following listing would be a valid properties file:
You can also pass the --local
option (which is TRUE
by default) to indicate whether the properties file location should be resolved within the shell process itself.
If the location should be resolved from the Data Flow Server process, specify --local false
.
When using either app register
or app import
, if a task application is already registered with
the provided name and version, it is not overridden by default. If you would like to override the
pre-existing task application with a different uri
or uri-metadata
location, include the --force
option.
In some cases, the resource is resolved on the server side.
In other cases, the URI is passed to a runtime container instance, where it is resolved.
Consult the specific documentation of each Data Flow Server for more detail.
25.3. Creating a Task Definition
You can create a task definition from a task application by providing a definition name as well as
properties that apply to the task execution. You can create a task definition through
the RESTful API or the shell. To create a task definition by using the shell, use the
task create
command to create the task definition, as shown in the following example:
You can obtain a listing of the current task definitions through the RESTful API or the shell.
To get the task definition list by using the shell, use the task list
command.
25.3.1. Maximum Task Definition Name Length
The maximum character length of a task definition name is dependent on the platform.
25.3.2. Automating the Creation of Task Definitions
As of version 2.3.0, you can configure the Data Flow server to automatically create task definitions by setting spring.cloud.dataflow.task.autocreate-task-definitions
to true
.
This is not the default behavior but is provided as a convenience.
When this property is enabled, a task launch request can specify the registered task application name as the task name.
If the task application is registered, the server creates a basic task definition that specifies only the application name, as required. This eliminates a manual step similar to:
25.4. Launching a Task
An ad hoc task can be launched through the RESTful API or the shell.
To launch an ad hoc task through the shell, use the task launch
command, as shown in the following example:
You can pass in additional properties meant for a TaskLauncher
itself by using the --properties
option.
The format of this option is a comma-separated string of properties prefixed with app.<task definition name>.<property>
.
Properties are passed to TaskLauncher
as application properties.
It is up to an implementation to choose how those are passed into an actual task application.
If the property is prefixed with deployer
instead of app
, it is passed to TaskLauncher
as a deployment property, and its meaning may be TaskLauncher
implementation specific.
This timestamp
property is actually the same as the timestamp.format
property specified by the timestamp application.
Data Flow adds the ability to use the shorthand form format
instead of timestamp.format
.
You can also specify the longhand version as well, as shown in the following example:
This shorthand behavior is discussed more in the section on Stream Application Properties.
If you have registered application property metadata, you can use tab completion in the shell after typing --
to get a list of candidate property names.
The shell provides tab completion for application properties. The app info --name <appName> --type <appType>
shell command provides additional documentation for all the supported properties. The supported task <appType>
is task
.
25.4.2. Common application properties
In addition to configuration through DSL, Spring Cloud Data Flow provides a mechanism for setting properties that are common to all the task applications that are launched by it.
You can do so by adding properties prefixed with spring.cloud.dataflow.applicationProperties.task
when starting the server.
The server then passes all the properties, without the prefix, to the instances it launches.
For example, you can configure all the launched applications to use the prop1
and prop2
properties by launching the Data Flow server with the following options:
Properties configured by using this mechanism have lower precedence than task deployment properties.
They are overridden if a property with the same key is specified at task launch time (for example, app.trigger.prop2
overrides the common property).
25.5. Limit the number concurrent task launches
Spring Cloud Data Flow lets a user limit the maximum number of concurrently running tasks for each configured platform to prevent the saturation of IaaS or hardware resources.
By default, the limit is set to 20
for all supported platforms. If the number of concurrently running tasks on a platform instance is greater than or equal to the limit, the next task launch request fails, and an error message is returned through the RESTful API, the Shell, or the UI.
You can configure this limit for a platform instance by setting the corresponding deployer property, spring.cloud.dataflow.task.platform.<platform-type>.accounts[<account-name>].maximumConcurrentTasks
, where <account-name>
is the name of a configured platform account (default
if no accounts are explicitly configured).
The <platform-type>
refers to one of the currently supported deployers: local
or kubernetes
. For cloudfoundry
, the property is spring.cloud.dataflow.task.platform.<platform-type>.accounts[<account-name>].deployment.maximumConcurrentTasks
. (The difference is that deployment
has been added to the path).
The TaskLauncher
implementation for each supported platform determines the number of currently running tasks by querying the underlying platform’s runtime state, if possible. The method for identifying a task
varies by platform.
For example, launching a task on the local host uses the LocalTaskLauncher
. LocalTaskLauncher
runs a process for each launch request and keeps track of these processes in memory. In this case, we do not query the underlying OS, as it is impractical to identify tasks this way.
For Cloud Foundry, tasks are a core concept supported by its deployment model. The state of all tasks ) is available directly through the API.
This means that every running task container in the account’s organization and space is included in the running execution count, whether or not it was launched by using Spring Cloud Data Flow or by invoking the CloudFoundryTaskLauncher
directly.
For Kubernetes, launching a task through the KubernetesTaskLauncher
, if successful, results in a running pod, which we expect to eventually complete or fail.
In this environment, there is generally no easy way to identify pods that correspond to a task.
For this reason, we count only pods that were launched by the KubernetesTaskLauncher
.
Since the task launcher provides task-name
label in the pod’s metadata, we filter all running pods by the presence of this label.
25.6. Reviewing Task Executions
Once the task is launched, the state of the task is stored in a relational database. The state
includes:
You can check the status of your task executions through the RESTful API or the shell.
To display the latest task executions through the shell, use the task execution list
command.
To get a list of task executions for just one task definition, add --name
and
the task definition name — for example, task execution list --name foo
. To retrieve full
details for a task execution, use the task execution status
command with the ID of the task execution,
for example task execution status --id 549
.
25.7. Destroying a Task Definition
Destroying a task definition removes the definition from the definition repository.
This can be done through the RESTful API or the shell.
To destroy a task through the shell, use the task destroy
command, as shown in the following example:
By default, the cleanup
option is set to false
(that is, by default, the task executions are not cleaned up when the task is destroyed).
To destroy all tasks through the shell, use the task all destroy
command as shown in the following example:
task destroy <task-name>
deletes only the definition and not the task deployed on Cloud Foundry.
The only way to do delete the task is through the CLI in two steps:
. Obtain a list of the apps by using the cf apps
command.
. Identify the task application to be deleted and run the cf delete <task-name>
command.
25.8. Validating a Task
Sometimes, an application contained within a task definition has an invalid URI in its registration.
This can be caused by an invalid URI being entered at application-registration time or the by the application being removed from the repository from which it was to be drawn.
To verify that all the applications contained in a task are resolve-able, use the validate
command, as follows:
dataflow:>task validate time-stamp
╔══════════╤═══════════════╗
║Task Name │Task Definition║
╠══════════╪═══════════════╣
║time-stamp│timestamp ║
╚══════════╧═══════════════╝
time-stamp is a valid task.
╔═══════════════╤═════════════════╗
║ App Name │Validation Status║
╠═══════════════╪═════════════════╣
║task:timestamp │valid ║
╚═══════════════╧═════════════════╝
In the preceding example, the user validated their time-stamp task. The task:timestamp
application is valid.
Now we can see what happens if we have a stream definition with a registered application that has an invalid URI:
dataflow:>task validate bad-timestamp
╔═════════════╤═══════════════╗
║ Task Name │Task Definition║
╠═════════════╪═══════════════╣
║bad-timestamp│badtimestamp ║
╚═════════════╧═══════════════╝
bad-timestamp is an invalid task.
╔══════════════════╤═════════════════╗
║ App Name │Validation Status║
╠══════════════════╪═════════════════╣
║task:badtimestamp │invalid ║
╚══════════════════╧═════════════════╝
25.9. Stopping a Task Execution
In some cases, a task that is running on a platform may not stop because of a problem on the platform or the application business logic itself.
For such cases, Spring Cloud Data Flow offers the ability to send a request to the platform to end the task.
To do this, submit a task execution stop
for a given set of task executions, as follows:
dataflow:>task execution list
╔══════════╤══╤════════════════════════════╤════════════════════════════╤═════════╗
║Task Name │ID│ Start Time │ End Time │Exit Code║
╠══════════╪══╪════════════════════════════╪════════════════════════════╪═════════╣
║batch-demo│5 │Mon Jul 15 13:58:41 EDT 2019│Mon Jul 15 13:58:55 EDT 2019│0 ║
║timestamp │1 │Mon Jul 15 09:26:41 EDT 2019│Mon Jul 15 09:26:41 EDT 2019│0 ║
╚══════════╧══╧════════════════════════════╧════════════════════════════╧═════════╝
When stopping a task execution that has a running Spring Batch job, the job is left with a batch status of STARTED
.
Each of the supported platforms sends a SIG-INT to the task application when a stop is requested. That allows Spring Cloud Task to capture the state of the app. However, Spring Batch does not handle a SIG-INT and, as a result, the job stops but remains in the STARTED status.
25.9.1. Stopping a Task Execution that was Started Outside of Spring Cloud Data Flow
You may wish to stop a task that has been launched outside of Spring Cloud Data Flow. An example of this is the worker applications launched by a remote batch partitioned application.
In such cases, the remote batch partitioned application stores the external-execution-id
for each of the worker applications. However, no platform information is stored.
So when Spring Cloud Data Flow has to stop a remote batch partitioned application and its worker applications, you need to specify the platform name, as follows:
You can also tap into various task and batch events when the task is launched.
If the task is enabled to generate task or batch events (with the additional dependencies of spring-cloud-task-stream
and, in the case of Kafka as the binder, spring-cloud-stream-binder-kafka
), those events are published during the task lifecycle.
By default, the destination names for those published events on the broker (Rabbit, Kafka, and others) are the event names themselves (for instance: task-events
, job-execution-events
, and so on).
dataflow:>task create myTask --definition "myBatchJob"
dataflow:>stream create task-event-subscriber1 --definition ":task-events > log" --deploy
dataflow:>task launch myTask
The following table lists the default task and batch event and destination names on the broker:
Table 2. Task and Batch Event Destinations
Spring Cloud Data Flow lets you create a directed graph, where each node of the graph is a task application.
This is done by using the DSL for composed tasks.
You can create a composed task through the RESTful API, the Spring Cloud Data Flow Shell, or the Spring Cloud Data Flow UI.
27.1. The Composed Task Runner
Composed tasks are run through a task application called the Composed Task Runner. The Spring Cloud Data Flow server automatically deploys the Composed Task Runner when launching a composed task.
27.1.1. Configuring the Composed Task Runner
The composed task runner application has a dataflow-server-uri
property that is used for validation and for launching child tasks.
This defaults to localhost:9393
. If you run a distributed Spring Cloud Data Flow server, as you would if you deploy the server on Cloud Foundry or Kubernetes, you need to provide the URI that can be used to access the server.
You can either provide this by setting the dataflow-server-uri
property for the composed task runner application when launching a composed task or by setting the spring.cloud.dataflow.server.uri
property for the Spring Cloud Data Flow server when it is started.
For the latter case, the dataflow-server-uri
composed task runner application property is automatically set when a composed task is launched.
Configuration Options
The ComposedTaskRunner
task has the following options:
composed-task-arguments
The command line arguments to be used for each of the tasks. (String, default: <none>).
increment-instance-enabled
Allows a single ComposedTaskRunner
instance to be run again without changing the parameters by adding a incremented number job parameter based on run.id
from the previous execution. (Boolean, default: true
).
ComposedTaskRunner is built by using Spring Batch. As a result, upon a successful execution, the batch job is considered to be complete.
To launch the same ComposedTaskRunner
definition multiple times, you must set either increment-instance-enabled
or uuid-instance-enabled
property to true
or change the parameters for the definition for each launch.
When using this option, it must be applied for all task launches for the desired application, including the first launch.
uuid-instance-enabled
Allows a single ComposedTaskRunner
instance to be run again without changing the parameters by adding a UUID to the ctr.id
job parameter. (Boolean, default: false
).
ComposedTaskRunner is built by using Spring Batch. As a result, upon a successful execution, the batch job is considered to be complete.
To launch the same ComposedTaskRunner
definition multiple times, you must set either increment-instance-enabled
or uuid-instance-enabled
property to true
or change the parameters for the definition for each launch.
When using this option, it must be applied for all task launches for the desired application, including the first launch. This option when set to true will override the value of increment-instance-id
.
Set this option to true
when running multiple instances of the same composed task definition at the same time.
interval-time-between-checks
The amount of time, in milliseconds, that the ComposedTaskRunner
waits between checks of the database to see if a task has completed. (Integer, default: 10000
).
ComposedTaskRunner
uses the datastore to determine the status of each child tasks. This interval indicates to ComposedTaskRunner
how often it should check the status its child tasks.
transaction-isolation-level
Establish the transaction isolation level for the Composed Task Runner.
A list of available transaction isolation levels can be found here.
Default is ISOLATION_REPEATABLE_READ
.
max-wait-time
The maximum amount of time, in milliseconds, that an individual step can run before the execution of the Composed task is failed (Integer, default: 0).
Determines the maximum time each child task is allowed to run before the CTR ends with a failure. The default of 0
indicates no timeout.
split-thread-allow-core-thread-timeout
Specifies whether to allow split core threads to timeout. (Boolean, default: false
)
Sets the policy governing whether core threads may timeout and terminate if no tasks arrive within the keep-alive time, being replaced if needed when new tasks arrive.
split-thread-core-pool-size
Split’s core pool size. (Integer, default: 1
)
Each child task contained in a split requires a thread in order to execute. So, for example, a definition such as <AAA || BBB || CCC> && <DDD || EEE>
would require a split-thread-core-pool-size
of 3
.
This is because the largest split contains three child tasks. A count of 2
would mean that AAA
and BBB
would run in parallel, but CCC would wait until either AAA
or BBB
finish in order to run.
Then DDD
and EEE
would run in parallel.
split-thread-keep-alive-seconds
Split’s thread keep alive seconds. (Integer, default: 60
)
If the pool currently has more than corePoolSize
threads, excess threads are stopped if they have been idle for more than the keepAliveTime
.
split-thread-max-pool-size
Split’s maximum pool size. (Integer, default: Integer.MAX_VALUE
).
Establish the maximum number of threads allowed for the thread pool.
split-thread-queue-capacity
Capacity for Split’s BlockingQueue
. (Integer, default: Integer.MAX_VALUE
)
If fewer than corePoolSize
threads are running, the Executor
always prefers adding a new thread rather than queuing.
If corePoolSize
or more threads are running, the Executor
always prefers queuing a request rather than adding a new thread.
If a request cannot be queued, a new thread is created unless this would exceed maximumPoolSize
. In that case, the task is rejected.
split-thread-wait-for-tasks-to-complete-on-shutdown
Whether to wait for scheduled tasks to complete on shutdown, not interrupting running tasks and running all tasks in the queue. (Boolean, default: false
)
dataflow-server-uri
The URI for the Data Flow server that receives task launch requests. (String, default: localhost:9393
)
dataflow-server-username
The optional username for the Data Flow server that receives task launch requests.
Used to access the the Data Flow server by using Basic Authentication. Not used if dataflow-server-access-token
is set.
dataflow-server-password
The optional password for the Data Flow server that receives task launch requests.
Used to access the the Data Flow server by using Basic Authentication. Not used if dataflow-server-access-token
is set.
dataflow-server-access-token
This property sets an optional OAuth2 Access Token.
Typically, the value is automatically set by using the token from the currently logged-in user, if available.
However, for special use-cases, this value can also be set explicitly.
A special boolean property, dataflow-server-use-user-access-token
, exists for when you want to use the access token of the currently logged-in user and propagate it to the Composed Task Runner. This property is used
by Spring Cloud Data Flow and, if set to true
, auto-populates the dataflow-server-access-token
property. When using dataflow-server-use-user-access-token
, it must be passed for each task execution.
In some cases, it may be preferred that the user’s dataflow-server-access-token
must be passed for each composed task launch by default.
In this case, set the Spring Cloud Data Flow spring.cloud.dataflow.task.useUserAccessToken
property to true
.
To set a property for Composed Task Runner you will need to prefix the property with app.composed-task-runner.
.
For example to set the dataflow-server-uri
property the property will look like app.composed-task-runner.dataflow-server-uri
.
dataflow:> app register --name timestamp --type task --uri maven://org.springframework.cloud.task.app:timestamp-task:
dataflow:> app register --name mytaskapp --type task --uri file:///home/tasks/mytask.jar
dataflow:> task create my-composed-task --definition "mytaskapp && timestamp"
dataflow:> task launch my-composed-task
In the preceding example, we assume that the applications to be used by our composed task have not yet been registered.
Consequently, in the first two steps, we register two task applications.
We then create our composed task definition by using the task create
command.
The composed task DSL in the preceding example, when launched, runs mytaskapp
and then runs the timestamp application.
But before we launch the my-composed-task
definition, we can view what Spring Cloud Data Flow generated for us.
This can be done by using the task list command, as shown (including its output) in the following example:
dataflow:>task list
╔══════════════════════════╤══════════════════════╤═══════════╗
║ Task Name │ Task Definition │Task Status║
╠══════════════════════════╪══════════════════════╪═══════════╣
║my-composed-task │mytaskapp && timestamp│unknown ║
║my-composed-task-mytaskapp│mytaskapp │unknown ║
║my-composed-task-timestamp│timestamp │unknown ║
╚══════════════════════════╧══════════════════════╧═══════════╝
In the example, Spring Cloud Data Flow created three task definitions, one for each of the applications that makes up our composed task (my-composed-task-mytaskapp
and my-composed-task-timestamp
) as well as the composed task (my-composed-task
) definition.
We also see that each of the generated names for the child tasks is made up of the name of the composed task and the name of the application, separated by a hyphen -
(as in my-composed-task -
mytaskapp).
Task Application Parameters
The task applications that make up the composed task definition can also contain parameters, as shown in the following example:
dataflow:>task execution list
╔══════════════════════════╤═══╤════════════════════════════╤════════════════════════════╤═════════╗
║ Task Name │ID │ Start Time │ End Time │Exit Code║
╠══════════════════════════╪═══╪════════════════════════════╪════════════════════════════╪═════════╣
║my-composed-task-timestamp│713│Wed Apr 12 16:43:07 EDT 2017│Wed Apr 12 16:43:07 EDT 2017│0 ║
║my-composed-task-mytaskapp│712│Wed Apr 12 16:42:57 EDT 2017│Wed Apr 12 16:42:57 EDT 2017│0 ║
║my-composed-task │711│Wed Apr 12 16:42:55 EDT 2017│Wed Apr 12 16:43:15 EDT 2017│0 ║
╚══════════════════════════╧═══╧════════════════════════════╧════════════════════════════╧═════════╝
In the preceding example, we see that my-compose-task
launched and that the other tasks were also launched in sequential order.
Each of them ran successfully with an Exit Code
as 0
.
Passing Properties to the Child Tasks
To set the properties for child tasks in a composed task graph at task launch time,
use the following format: app.<child task app name>.<property>
.
The following listing shows a composed task definition as an example:
task launch my-composed-task --properties "deployer.mytaskapp.memory=2048m,app.mytimestamp.timestamp.format=HH:mm:ss"
Launched task 'a1'
dataflow:>task create my-composed-task --definition "<aaa: timestamp || bbb: timestamp>"
Created new task 'my-composed-task'
dataflow:>task launch my-composed-task --arguments "--increment-instance-enabled=true --max-wait-time=50000 --split-thread-core-pool-size=4" --properties "app.bbb.timestamp.format=dd/MM/yyyy HH:mm:ss"
Launched task 'my-composed-task'
If no ExitMessage
is present and the ExitCode
is set to zero, the ExitStatus
for the step is COMPLETED
.
If no ExitMessage
is present and the ExitCode
is set to any non-zero number, the ExitStatus
for the step is FAILED
.
27.2.3. Destroying a Composed Task
The command used to destroy a stand-alone task is the same as the command used to destroy a composed task.
The only difference is that destroying a composed task also destroys the child tasks associated with it.
The following example shows the task list before and after using the destroy
command:
dataflow:>task list
╔══════════════════════════╤══════════════════════╤═══════════╗
║ Task Name │ Task Definition │Task Status║
╠══════════════════════════╪══════════════════════╪═══════════╣
║my-composed-task │mytaskapp && timestamp│COMPLETED ║
║my-composed-task-mytaskapp│mytaskapp │COMPLETED ║
║my-composed-task-timestamp│timestamp │COMPLETED ║
╚══════════════════════════╧══════════════════════╧═══════════╝
dataflow:>task destroy my-composed-task
dataflow:>task list
╔═════════╤═══════════════╤═══════════╗
║Task Name│Task Definition│Task Status║
╚═════════╧═══════════════╧═══════════╝
To stop a composed task through the dashboard, select the Jobs tab and click the *Stop() button next to the job execution that you want to stop.
The composed task run is stopped when the currently running child task completes.
The step associated with the child task that was running at the time that the composed task was stopped is marked as STOPPED
as well as the composed task job execution.
27.2.5. Restarting a Composed Task
In cases where a composed task fails during execution and the status of the composed task is FAILED
, the task can be restarted.
You can do so through the:
28.1. Conditional Execution
Conditional execution is expressed by using a double ampersand symbol (&&
).
This lets each task in the sequence be launched only if the previous task
successfully completed, as shown in the following example:
When the composed task called my-composed-task
is launched, it launches the task called task1
and, if task1
completes successfully, the task called task2
is launched.
If task1
fails, task2
does not launch.
You can also use the Spring Cloud Data Flow Dashboard to create your conditional execution, by using the designer to drag and drop applications that are required and connecting them together to create your directed graph, as shown in the following image:
The preceding diagram is a screen capture of the directed graph as it being created by using the Spring Cloud Data Flow Dashboard.
You can see that four components in the diagram comprise a conditional execution:
28.2. Transitional Execution
The DSL supports fine-grained control over the transitions taken during the execution of the directed graph.
Transitions are specified by providing a condition for equality that is based on the exit status of the previous task.
A task transition is represented by the following symbol ->
.
28.2.1. Basic Transition
A basic transition would look like the following:
In the preceding example, foo
would launch, and, if it had an exit status of FAILED
, the bar
task would launch.
If the exit status of foo
was COMPLETED
, baz
would launch.
All other statuses returned by cat
have no effect, and the task would end normally.
Using the Spring Cloud Data Flow Dashboard to create the same “basic transition” would resemble the following image:
The preceding diagram is a screen capture of the directed graph as it being created in the Spring Cloud Data Flow Dashboard.
Notice that there are two different types of connectors:
Dashed line: Represents transitions from the application to one of the possible destination applications.
Solid line: Connects applications in a conditional execution or a connection between the application and a control node (start or end).
When creating a transition, link the application to each possible destination by using the connector.
Once complete, go to each connection and select it by clicking it.
A bolt icon appears.
Click that icon.
Enter the exit status required for that connector.
The solid line for that connector turns to a dashed line.
In the preceding example, foo
would launch, and, if it had an exit status of FAILED
, bar
task would launch.
For any exit status of cat
other than FAILED
, baz
would launch.
Using the Spring Cloud Data Flow Dashboard to create the same “transition with wildcard” would resemble the following image:
28.2.3. Transition With a Following Conditional Execution
A transition can be followed by a conditional execution, so long as the wildcard
is not used, as shown in the following example:
In the preceding example, foo
would launch, and, if it had an exit status of FAILED
, the bar
task would launch.
If foo
had an exit status of UNKNOWN
, baz
would launch.
For any exit status of foo
other than FAILED
or UNKNOWN
, qux
would launch and, upon successful completion, quux
would launch.
Using the Spring Cloud Data Flow Dashboard to create the same “transition with conditional execution” would resemble the following image:
28.2.4. Ignoring Exit Message
If any child task within a split returns an ExitMessage
other than COMPLETED
the split
will have an ExitStatus
of FAILED
. To ignore the ExitMessage
of a child task,
add the ignoreExitMessage=true
for each app that will return an ExitMessage
within the split. When using this flag, the ExitStatus
of the task will be
COMPLETED
if the ExitCode
of the child task is zero. The split will have an
ExitStatus
of FAILED
if the ExitCode`s is non zero. There are 2 ways to
set the `ignoreExitMessage
flag:
Setting the property for each of the apps that need to have their exitMessage
ignored within the split. For example a split like <AAA || BBB>
where BBB
will return an exitMessage
, you would set the ignoreExitMessage
property like
app.BBB.ignoreExitMessage=true
You can also set it for all apps using the composed-task-arguments property,
for example: --composed-task-arguments=--ignoreExitMessage=true
.
28.3. Split Execution
Splits let multiple tasks within a composed task be run in parallel.
It is denoted by using angle brackets (<>
) to group tasks and flows that are to be run in parallel.
These tasks and flows are separated by the double pipe ||
symbol, as shown in the following example:
In the preceding example, the foo
, bar
, and baz
tasks are launched in parallel.
Once they all complete, then the qux
and quux
tasks are launched in parallel.
Once they complete, the composed task ends.
However, if foo
, bar
, or baz
fails, the split containing qux
and quux
does not launch.
Using the Spring Cloud Data Flow Dashboard to create the same “split with multiple groups” would resemble the following image:
Tasks that are used in a split should not set the their ExitMessage
. Setting the ExitMessage
is only to be used
with transitions.
In the preceding example, we see that foo
and baz
are launched in parallel.
However, bar
does not launch until foo
completes successfully.
Using the Spring Cloud Data Flow Dashboard to create the same " split containing conditional execution
" resembles the following image:
28.3.2. Establishing the Proper Thread Count for Splits
Each child task contained in a split requires a thread in order to run. To set this properly, you want to look at your graph and find the split that has the largest number of child tasks. The number of child tasks in that split is the number of threads you need.
To set the thread count, use the split-thread-core-pool-size property
(defaults to 1
). So, for example, a definition such as <AAA || BBB || CCC> && <DDD || EEE>
requires a split-thread-core-pool-size
of 3
.
This is because the largest split contains three child tasks. A count of two would mean that AAA
and BBB
would run in parallel but CCC would wait for either AAA
or BBB
to finish in order to run.
Then DDD
and EEE
would run in parallel.
You can launch a task from a stream by using the task-launcher-dataflow
sink which is provided as a part of the Spring Cloud Data Flow project.
The sink connects to a Data Flow server and uses its REST API to launch any defined task.
The sink accepts a JSON payload representing a task launch request
, which provides the name of the task to launch and may include command line arguments and deployment properties.
The task-launch-request-function
component, in conjunction with Spring Cloud Stream functional composition, can transform the output of any source or processor to a task launch request.
Adding a dependency to task-launch-request-function
auto-configures a java.util.function.Function
implementation, registered through Spring Cloud Function as a taskLaunchRequest
.
For example, you can start with the time source, add the following dependency, build it, and register it as a custom source.
<dependency>
<groupId>org.springframework.cloud.stream.app</groupId>
<artifactId>app-starters-task-launch-request-common</artifactId>
</dependency>
This will create an apps
directory that contains time-source-rabbit
and time-source-kafka
directories in the <stream app project>/applications/source/time-source
directory. In each of these you will see a target directory that contains a time-source-<binder>-<version>.jar
. Now register the time-source
jar (use the appropriate binder jar) with SCDF as a time source named timestamp-tlr
.
Next, register the task-launcher-dataflow
sink with SCDF and create a task definition timestamp-task
. Once this is complete create the stream definition as shown below:
The preceding stream produces a task launch request every minute. The request provides the name of the task to launch: {"name":"timestamp-task"}
.
The following stream definition illustrates the use of command line arguments. It produces messages such as {"args":["foo=bar","time=12/03/18 17:44:12"],"deploymentProps":{},"name":"timestamp-task"}
to provide command-line arguments to the task:
stream create --name task-every-second --definition 'timestamp-tlr --task.launch.request.task-name=timestamp-task --spring.cloud.function.definition=\"timeSupplier|taskLaunchRequestFunction\" --task.launch.request.args=foo=bar --task.launch.request.arg-expressions=time=payload | tasklauncher-sink' --deploy
Note the use of SpEL expressions to map each message payload to the time
command-line argument, along with a static argument (foo=bar
).
You can then see the list of task executions by using the shell command task execution list
, as shown (with its output) in the following example:
dataflow:>task execution list
╔══════════════╤═══╤════════════════════════════╤════════════════════════════╤═════════╗
║ Task Name │ID │ Start Time │ End Time │Exit Code║
╠══════════════╪═══╪════════════════════════════╪════════════════════════════╪═════════╣
║timestamp-task│581│Thu Sep 08 11:38:33 EDT 2022│Thu Sep 08 11:38:33 EDT 2022│0 ║
║timestamp-task│580│Thu Sep 08 11:38:31 EDT 2022│Thu Sep 08 11:38:31 EDT 2022│0 ║
║timestamp-task│579│Thu Sep 08 11:38:29 EDT 2022│Thu Sep 08 11:38:29 EDT 2022│0 ║
║timestamp-task│578│Thu Sep 08 11:38:26 EDT 2022│Thu Sep 08 11:38:26 EDT 2022│0 ║
╚══════════════╧═══╧════════════════════════════╧════════════════════════════╧═════════╝
In this example, we have shown how to use the time
source to launch a task at a fixed rate.
This pattern may be applied to any source to launch a task in response to any event.
29.1. Launching a Composed Task From a Stream
A composed task can be launched with the task-launcher-dataflow
sink, as discussed here.
Since we use the ComposedTaskRunner
directly, we need to set up the task definitions for the composed task runner itself, along with the composed tasks, prior to the creation of the composed task launching stream.
Suppose we wanted to create the following composed task definition: AAA && BBB
.
The first step would be to create the task definition, as shown in the following example:
Now that the task definition we need for composed task definition is ready, we need to create a stream that launches composed-task-sample
.
We create a stream with:
As discussed in the Tasks documentation, Spring
Cloud Data Flow lets you view Spring Cloud Task application executions. So, in
this section, we discuss what is required for a task application and Spring
Cloud Data Flow to share the task execution information.
30.1. A Common DataStore Dependency
Spring Cloud Data Flow supports many databases out-of-the-box,
so all you typically need to do is declare the spring_datasource_*
environment variables
to establish what data store Spring Cloud Data Flow needs.
Regardless of which database you decide to use for Spring Cloud Data Flow, make sure that your task also
includes that database dependency in its pom.xml
or gradle.build
file. If the database dependency
that is used by Spring Cloud Data Flow is not present in the Task Application, the task fails
and the task execution is not recorded.
30.2. A Common Data Store
Spring Cloud Data Flow and your task application must access the same datastore instance.
This is so that the task executions recorded by the task application can be read by Spring Cloud Data Flow to list them in the Shell and Dashboard views.
Also, the task application must have read and write privileges to the task data tables that are used by Spring Cloud Data Flow.
Given this understanding of the datasource dependency between Task applications and Spring Cloud Data Flow, you can now review how to apply them in various Task orchestration scenarios.
30.2.1. Simple Task Launch
When launching a task from Spring Cloud Data Flow, Data Flow adds its datasource
properties (spring.datasource.url
, spring.datasource.driverClassName
, spring.datasource.username
, spring.datasource.password
)
to the application properties of the task being launched. Thus, a task application
records its task execution information to the Spring Cloud Data Flow repository.
30.2.2. Composed Task Runner
Spring Cloud Data Flow lets you create a directed graph where each node
of the graph is a task application. This is done through the
composed task runner.
In this case, the rules that applied to a simple task launch
or task launcher sink apply to the composed task runner as well.
All child applications must also have access to the datastore that is being used by the composed task runner.
Also, all child applications must have the same database dependency as the composed task runner enumerated in their pom.xml
or gradle.build
file.
30.2.3. Launching a Task Externally from Spring Cloud Data Flow
You can launch Spring Cloud Task applications by using another method (scheduler, for example) but still track the task execution in Spring Cloud Data Flow.
You can do so, provided the task applications observe the rules specified here and here.
If you want to use Spring Cloud Data Flow to view your
Spring Batch jobs, make sure that
your batch application uses the @EnableTask
annotation and follow the rules enumerated here and here.
More information is available here.
Spring Cloud Data Flow lets you schedule the execution of tasks with a cron
expression.
You can create a schedule through the RESTful API or the Spring Cloud Data Flow UI.
31.1. The Scheduler
Spring Cloud Data Flow schedules the execution of its tasks through a scheduling agent that is available on the cloud platform.
When using the Cloud Foundry platform, Spring Cloud Data Flow uses the PCF Scheduler.
When using Kubernetes, a CronJob will be used.
dataflow:>task schedule create --definitionName mytask --name mytaskschedule --expression '*/1 * * * *'
Created schedule 'mytaskschedule'
Maximum Length for a Schedule Name
The maximum character length of a schedule name is dependent on the platform.
Table 3. Maximum Schedule Name Character Length by Platform
dataflow:>task schedule list
╔══════════════════════════╤════════════════════╤════════════════════════════════════════════════════╗
║ Schedule Name │Task Definition Name│ Properties ║
╠══════════════════════════╪════════════════════╪════════════════════════════════════════════════════╣
║mytaskschedule │mytask │spring.cloud.scheduler.cron.expression = */1 * * * *║
╚══════════════════════════╧════════════════════╧════════════════════════════════════════════════════╝
As task applications evolve, you want to get your updates to production. This section walks through the capabilities that Spring Cloud Data Flow provides around being able to update task applications.
When a task application is registered (see Registering a Task Application), a version is associated with it. A task application can have multiple versions associated with it, with one selected as the default. The following image illustrates an application with multiple versions associated with it (see the timestamp entry).
Versions of an application are managed by registering multiple applications with the same name and coordinates, except the version. For example, if you were to register an application with the following values, you would get one application registered with two versions (2.1.0.RELEASE and 2.1.1.RELEASE):
Besides having multiple versions, Spring Cloud Data Flow needs to know which version to run on the next launch. This is indicated by setting a version to be the default version. Whatever version of a task application is configured as the default version is the one to be run on the next launch request. You can see which version is the default in the UI, as this image shows:
32.1. Task Launch Lifecycle
In previous versions of Spring Cloud Data Flow, when the request to launch a task was received, Spring Cloud Data Flow would deploy the application (if needed) and run it. If the application was being run on a platform that did not need to have the application deployed every time (CloudFoundry, for example), the previously deployed application was used. This flow has changed in 2.3. The following image shows what happens when a task launch request comes in now:
There are three main flows to consider in the preceding diagram. Launching the first time or launching with no changes is one. The other two are launching when there are changes but the appliction is not currently and launching when there are changes and the application is running. We look at the flow with no changes first.
32.1.1. Launching a Task With No Changes
A launch request comes into Data Flow. Data Flow determines that an upgrade is not required, since nothing has changed (no properties, deployment properties, or versions have changed since the last execution).
On platforms that cache a deployed artifact (CloudFoundry, at this writing), Data Flow checks whether the application was previously deployed.
If the application needs to be deployed, Data Flow deploys the task application.
Data Flow launches the application.
A launch request comes into Data Flow. Data Flow determines that an upgrade is required, since there was a change in the task application version, the application properties, or the deployment properties.
Data Flow checks to see whether another instance of the task definition is currently running.
If there is no other instance of the task definition currently running, the old deployment is deleted.
On platforms that cache a deployed artifact (CloudFoundry, at this writing), Data Flow checks whether the application was previously deployed (this check evaluates to false
in this flow, since the old deployment was deleted).
Data Flow does the deployment of the task application with the updated values (new application version, new merged properties, and new merged deployment properties).
Data Flow launches the application.
32.1.3. Launch a Task With Changes While Another Instance Is Running
The last main flow is when a launch request comes to Spring Cloud Data Flow to do an upgrade but the task definition is currently running. In this case, the launch is blocked due to the requirement to delete the current application. On some platforms (CloudFoundry, at this writing), deleting the application causes all currently running applications to be shut down. This feature prevents that from happening. The following process describes what happens when a task changes while another instance is running:
A launch request comes into Data Flow. Data Flow determines that an upgrade is required, since there was a change in the task application version, the application properties, or the deployment properties.
Data Flow checks to see whether another instance of the task definition is currently running.
Data Flow prevents the launch from happening, because other instances of the task definition are running.
See the Batch Developer section of the microsite for more about how to create, test, and run Spring Cloud Task applications on your local machine.
Task Monitoring
See the Task Monitoring Guide of the microsite for more about how to monitor the applications that were deployed as part of a task.
Dashboard
This section describes how to use the dashboard of Spring Cloud Data Flow.
Apps: The Apps tab lists all available applications and provides the controls to register and unregister them.
Runtime: The Runtime tab provides the list of all running applications.
Streams: The Streams tab lets you list, design, create, deploy, and destroy Stream Definitions.
Tasks: The Tasks tab lets you list, create, launch, schedule, and destroy Task Definitions.
Jobs: The Jobs tab lets you perform batch job related functions.
For example, if Spring Cloud Data Flow is running locally, the dashboard is available at localhost:9393/dashboard
.
If you have enabled HTTPS, the dashboard is available at localhost:9393/dashboard
.
If you have enabled security, a login form is available at localhost:9393/dashboard/#/login
.
The Applications tab of the dashboard lists all the available applications and provides the controls to register and unregister them (if applicable).
You can import a number of applications at once by using the Bulk Import Applications action.
The following image shows a typical list of available applications within the dashboard:
34.1. Bulk Import of Applications
Applications can be imported in numerous ways which are available on the "Applications" page.
For bulk import, the application definitions are expected to be expressed in a properties style, as follows:
In the "Import application coordinates from an HTTP URI location" section, you can specify a URI that points to a properties file stored elsewhere, it should contain properties formatted as shown in the previous example.
Alternatively, by using the Apps as Properties textbox in the "Import application coordinates from a properties file" section , you can directly list each property string. Finally, if the properties are stored in a local file, the Import a File option opens a local file browser to select the file.
After setting your definitions through one of these routes, click Import Application(s).
The following image shows an example page of one way to bulk import applications:
The Runtime tab of the Dashboard application shows the list of all running applications.
For each runtime applicaiton, the state of the deployment and the number of deployed instances is shown.
A list of the used deployment properties is available by clicking on the application ID.
The following image shows an example of the Runtime tab in use:
36.1. Working with Stream Definitions
The Streams section of the Dashboard includes the Definitions tab that provides a listing of stream definitions.
There you have the option to deploy or undeploy those stream definitions.
Additionally, you can remove the definition by clicking on Destroy.
Each row includes an arrow on the left, which you can click to see a visual representation of the definition.
Hovering over the boxes in the visual representation shows more details about the applications, including any options passed to them.
In the following screenshot, the timer
stream has been expanded to show the visual representation:
If you click the details button, the view changes to show a visual representation of that stream and any related streams.
In the preceding example, if you click details for the timer
stream, the view changes to the following view, which clearly shows the relationship between the three streams (two of them are tapping into the timer
stream):
36.2. Creating a Stream
The Streams section of the Dashboard includes the Create Stream tab, which makes the Spring Flo designer available. The designer is a canvas application that offers an interactive graphical interface for creating data pipelines.
In this tab, you can:
You should watch this screencast that highlights some of the "Flo for Spring Cloud Data Flow" capabilities.
The Spring Flo wiki includes more detailed content on core Flo capabilities.
The following image shows the Flo designer in use:
36.3. Deploying a Stream
The stream deploy page includes tabs that provide different ways to set up the deployment properties and deploy the stream.
The following screenshots show the stream deploy page for foobar
(time | log
).
You can define deployments properties by using:
Form builder tab: a builder that helps you to define deployment properties (deployer, application properties, and so on)
Free text tab: a free text area (for key-value pairs)
36.5. Creating Fan-In and Fan-Out Streams
In the Fan-in and Fan-out chapter, you can learn how to support fan-in and fan-out use cases by using named destinations.
The UI provides dedicated support for named destinations as well:
In this example, we have data from an HTTP Source and a JDBC Source that is being sent to the
sharedData channel, which represents a fan-in use case.
On the other end we have a Cassandra Sink and a File Sink subscribed to the sharedData channel, which represents a fan-out use case.
36.6. Creating a Tap Stream
Creating taps by using the Dashboard is straightforward.
Suppose you have a stream consisting of an HTTP Source and a File Sink and you would like to tap into the stream
to also send data to a JDBC Sink.
To create the tap stream, connect the output connector of the HTTP Source to the JDBC Sink.
The connection is displayed as a dotted line, indicating that you created a tap stream.
The primary stream (HTTP Source to File Sink) will be automatically named, in case you did not provide a name for the stream, yet.
When creating tap streams, the primary stream must always be explicitly named.
In the preceding image, the primary stream was named HTTP_INGEST.
By using the Dashboard, you can also switch the primary stream so that it becomes the secondary tap stream.
Hover over the existing primary stream, the line between HTTP Source and File Sink.
Several control icons appear, and, by clicking on the icon labeled Switch to/from tap,
you change the primary stream into a tap stream.
Do the same for the tap stream and switch it to a primary stream.
When interacting directly with named destinations,
there can be "n" combinations (Inputs/Outputs). This allows you to create complex topologies involving a
wide variety of data sources and destinations.
36.7. Import and Export Streams
The Import/Export tab of the Dashboard includes a page that provides the option to import and export streams.
The following image shows the streams export page:
Each application encapsulates a unit of work into a reusable component.
Within the Data Flow runtime environment, applications let you create definitions for streams as well as tasks.
Consequently, the Apps tab within the Tasks tab lets you create task definitions.
37.2. Definitions
This page lists the Data Flow task definitions and provides actions to launch or destroy those tasks.
The following image shows the Definitions page:
On this page, you can also specify various properties that are used during the deployment of the application.
Once you are satisfied with the task definition, you can click the CREATE TASK button. A dialog box then asks for a task definition name and description. At a minimum, you must provide a name for the new definition.
37.2.2. Creating Composed Task Definitions
The dashboard includes the Create Composed Task tab, which provides an interactive graphical interface for creating composed tasks.
In this tab, you can:
37.2.3. Launching Tasks
Once the task definition has been created, you can launch the tasks through the dashboard.
To do so, click the Tasks tab and select the task you want to launch by pressing Launch
.
The following image shows the Task Launch page:
37.2.4. Import/Export Tasks
The Import/Export page provides the option to import and export tasks. This is done by clicking the Import/Export option on the left side of page. From here, click the Export task(s): Create a JSON file with the selected tasks option. The Export Tasks(s)
page appears.
The following image shows the tasks export page:
Similarly, you can import task definitions. To do so, click the Import/Export option on the left side of page. From here, click the Import task(s): Import tasks from a JSON file option to show the Import Tasks page. On the Import Tasks page, you have to import from a valid JSON file. You can either manually draft the file or export the file from the Tasks Export page.
37.3. Executions
The Task Executions tab shows the current running and completed task executions. From this page, you can drill down into the Task Execution details page. Furthermore, you can relaunch a Task Execution or stop a running execution.
Finally, you can clean up one or more task executions. This operation removes any associated task or batch job from the underlying persistence store. This operation can only be triggered for parent task executions and cascades down to the child task executions (if there are any).
The following image shows the Executions tab:
Job Execution IDs links (Clicking the Job Execution Id will take you to the Job Execution Details for that Job Execution ID.)
Task Execution Duration
Task Execution Exit Message
Logging output from the Task Execution
37.4.1. Stop Executing Tasks
To submit a stop task execution request to the platform, click the drop down button next to the task execution that needs to be stopped.
Now click the Stop task option. The dashboard presents a dialog box asking if you are sure that you want to stop the task execution. If so, click Stop Task Execution(s)
.
The Job Executions tab of the Dashboard lets you inspect batch jobs.
The main section of the screen provides a list of job executions.
Batch jobs are tasks that each execute one or more batch jobs.
Each job execution has a reference to the task execution ID (in the Task ID column).
The list of job executions also shows the state of the underlying Job Definition.
Thus, if the underlying definition has been deleted, “No definition found” appears in the Status column.
You can take the following actions for each job:
38.1. Job Execution Details
After you have launched a batch job, the Job Execution Details page shows information about the job.
The following image shows the Job Execution Details page:
38.2. Step Execution Details
The Step Execution Details page provides information about an individual step within a job.
The following image shows the Step Execution Details page:
For exceptions, the Exit Description field contains additional error information.
However, this field can have a maximum of 2500 characters.
Therefore, in the case of long exception stack traces, trimming of error messages may occur.
When that happens, check the server log files for further details.
38.3. Step Execution History
Under Step Execution History, you can also view various metrics associated with the selected step, such as duration, read counts, write counts, and others across all of its executions.
For each metric there are 5 attributes:
Count - The number of step executions that the metric could have participated. It is not a count for the number of times the event occurred during each step execution.
Min - The minimum value for the metric across all the executions for this step.
Max - The maximum value for the metric across all the executions for this step.
Mean - The mean value for the metric across all the executions for this step.
Standard Deviation - The standard deviation for the metric across all the executions for this step.
Commit Count - The max, min, mean, and standard deviation for the number of commits of all the executions for the given step.
Duration - The max, min, mean, and standard deviation for the duration of all the executions for the given step.
Duration Per Read - The max, min, mean, and standard deviation for the duration per read of all the executions for the given step.
FilterCount - The max, min, mean, and standard deviation for the number of filters of all the executions for the given step.
Process Skip Count - The max, min, mean, and standard deviation for the process skips of all the executions for the given step.
Read Count - The max, min, mean, and standard deviation for the number of reads of all the executions for the given step.
Read Skip Count - The max, min, mean, and standard deviation for the number of read skips of all the executions for the given step.
Rollback Count - The max, min, mean, and standard deviation for the number of rollbacks of all the executions for the given step.
Write Count - The max, min, mean, and standard deviation for the number of writes of all the executions for the given step.
Write Skip Count - The max, min, mean, and standard deviation for the number of skips of all the executions for the given step.
The Auditing page of the Dashboard gives you access to recorded audit events. Audit events
are recorded for:
By clicking the show details icon (the “i” in a circle on the right), you can obtain further details regarding
the auditing details:
The written value of the audit data property depends on the performed audit operation and the action type.
For example, when a schedule is being created, the name of the task definition,
task definition properties, deployment properties, and command line arguments are written
to the persistence store.
Sensitive information is sanitized prior to saving the Audit Record, in a best-effort manner.
Any of the following keys are being detected and their sensitive values are
masked:
Spring Cloud Data Flow provides a REST API that lets you access all aspects of the server.
In fact, the Spring Cloud Data Flow shell is a first-class consumer of that API.
41.1. HTTP Version
Spring Cloud Data Flow establishes a RESTful API version that is updated when there is a breaking change to the API.
The API version can be seen at the end of the home page of Spring Cloud Data Flow as shown in the example below:
Used to update an existing resource, including partial updates. Also used for
resources that imply the concept of restarts
, such as tasks.
DELETE
Used to delete an existing resource.
201 Created
A new resource has been created successfully. The resource’s URI is available from the response’s Location
header.
204 No Content
An update to an existing resource has been applied successfully.
400 Bad Request
The request was malformed. The response body includes an error description that provides further information.
404 Not Found
The requested resource did not exist.
409 Conflict
The requested resource already exists. For example, the task already exists or the stream was already being deployed
422 Unprocessable Entity
Returned in cases where the job execution cannot be stopped or restarted.
41.6. Hypermedia
Spring Cloud Data Flow uses hypermedia, and resources include links to other resources
in their responses.
Responses are in the Hypertext Application from resource-to-resource Language (HAL) format.
Links can be found beneath the _links
key.
Users of the API should not create URIs themselves.
Instead, they should use the above-described links to navigate.
_links.streams/definitions/definition.href
String
Link to the streams/definitions/definition
_links.streams/definitions/definition.templated
Boolean
Link streams/definitions/definition is templated
_links.runtime/apps.href
String
Link to the runtime/apps
_links.runtime/apps/{appId}.href
String
Link to the runtime/apps/{appId}
_links.runtime/apps/{appId}.templated
Boolean
Link runtime/apps is templated
_links.runtime/apps/{appId}/instances.href
String
Link to the runtime/apps/{appId}/instances
_links.runtime/apps/{appId}/instances.templated
Boolean
Link runtime/apps/{appId}/instances is templated
_links.runtime/apps/{appId}/instances/{instanceId}.href
String
Link to the runtime/apps/{appId}/instances/{instanceId}
_links.runtime/apps/{appId}/instances/{instanceId}.templated
Boolean
Link runtime/apps/{appId}/instances/{instanceId} is templated
_links.runtime/apps/{appId}/instances/{instanceId}/post.href
String
Link to the runtime/apps/{appId}/instances/{instanceId}/post
_links.runtime/apps/{appId}/instances/{instanceId}/post.templated
Boolean
Link runtime/apps/{appId}/instances/{instanceId}/post is templated
_links.runtime/apps/{appId}/instances/{instanceId}/actuator[].href
String
Link to the runtime/apps/{appId}/instances/{instanceId}/actuator
_links.runtime/apps/{appId}/instances/{instanceId}/actuator[].templated
Boolean
Link runtime/apps/{appId}/instances/{instanceId}/actuator is templated
_links.runtime/streams.href
String
Link to the runtime/streams
_links.runtime/streams.templated
Boolean
Link runtime/streams is templated
_links.runtime/streams/{streamNames}.href
String
Link to the runtime/streams/{streamNames}
_links.runtime/streams/{streamNames}.templated
Boolean
Link runtime/streams/{streamNames} is templated
_links.streams/logs.href
String
Link to the streams/logs
_links.streams/logs/{streamName}.href
String
Link to the streams/logs/{streamName}
_links.streams/logs/{streamName}/{appName}.href
String
Link to the streams/logs/{streamName}/{appName}
_links.streams/logs/{streamName}.templated
Boolean
Link streams/logs/{streamName} is templated
_links.streams/logs/{streamName}/{appName}.templated
Boolean
Link streams/logs/{streamName}/{appName} is templated
_links.streams/deployments
Object
Link to streams/deployments
_links.streams/deployments.href
String
Link to streams/deployments
_links.streams/deployments/{name}
Object
Link streams/deployments/{name} is templated
_links.streams/deployments/{name}.href
String
Link streams/deployments/{name} is templated
_links.streams/deployments/{name}.templated
Boolean
Link streams/deployments/{name} is templated
_links.streams/deployments/{name}{?reuse-deployment-properties}.href
String
Link streams/deployments/{name} is templated
_links.streams/deployments/{name}{?reuse-deployment-properties}.templated
Boolean
Link streams/deployments/{name} is templated
_links.streams/deployments/deployment.href
String
Link to the streams/deployments/deployment
_links.streams/deployments/deployment.templated
Boolean
Link streams/deployments/deployment is templated
_links.streams/deployments/manifest/{name}/{version}.href
String
Link to the streams/deployments/manifest/{name}/{version}
_links.streams/deployments/manifest/{name}/{version}.templated
Boolean
Link streams/deployments/manifest/{name}/{version} is templated
_links.streams/deployments/history/{name}.href
String
Link to the streams/deployments/history/{name}
_links.streams/deployments/history/{name}.templated
Boolean
Link streams/deployments/history is templated
_links.streams/deployments/rollback/{name}/{version}.href
String
Link to the streams/deployments/rollback/{name}/{version}
_links.streams/deployments/rollback/{name}/{version}.templated
Boolean
Link streams/deployments/rollback/{name}/{version} is templated
_links.streams/deployments/update/{name}.href
String
Link to the streams/deployments/update/{name}
_links.streams/deployments/update/{name}.templated
Boolean
Link streams/deployments/update/{name} is templated
_links.streams/deployments/platform/list.href
String
Link to the streams/deployments/platform/list
_links.streams/deployments/scale/{streamName}/{appName}/instances/{count}.href
String
Link to the streams/deployments/scale/{streamName}/{appName}/instances/{count}
_links.streams/deployments/scale/{streamName}/{appName}/instances/{count}.templated
Boolean
Link streams/deployments/scale/{streamName}/{appName}/instances/{count} is templated
_links.streams/validation.href
String
Link to the streams/validation
_links.streams/validation.templated
Boolean
Link streams/validation is templated
_links.tasks/platforms.href
String
Link to the tasks/platforms
_links.tasks/definitions.href
String
Link to the tasks/definitions
_links.tasks/definitions/definition.href
String
Link to the tasks/definitions/definition
_links.tasks/definitions/definition.templated
Boolean
Link tasks/definitions/definition is templated
_links.tasks/executions.href
String
Link to the tasks/executions
_links.tasks/executions/name.href
String
Link to the tasks/executions/name
_links.tasks/executions/name.templated
Boolean
Link tasks/executions/name is templated
_links.tasks/executions/current.href
String
Link to the tasks/executions/current
_links.tasks/executions/execution.href
String
Link to the tasks/executions/execution
_links.tasks/executions/execution.templated
Boolean
Link tasks/executions/execution is templated
_links.tasks/info/executions.href
String
Link to the tasks/info/executions
_links.tasks/info/executions.templated
Boolean
Link tasks/info is templated
_links.tasks/logs.href
String
Link to the tasks/logs
_links.tasks/logs.templated
Boolean
Link tasks/logs is templated
_links.tasks/schedules.href
String
Link to the tasks/executions/schedules
_links.tasks/schedules/instances.href
String
Link to the tasks/schedules/instances
_links.tasks/schedules/instances.templated
Boolean
Link tasks/schedules/instances is templated
_links.tasks/validation.href
String
Link to the tasks/validation
_links.tasks/validation.templated
Boolean
Link tasks/validation is templated
_links.jobs/executions.href
String
Link to the jobs/executions
_links.jobs/thinexecutions.href
String
Link to the jobs/thinexecutions
_links.jobs/executions/name.href
String
Link to the jobs/executions/name
_links.jobs/executions/name.templated
Boolean
Link jobs/executions/name is templated
_links.jobs/executions/status.href
String
Link to the jobs/executions/status
_links.jobs/executions/status.templated
Boolean
Link jobs/executions/status is templated
_links.jobs/thinexecutions/name.href
String
Link to the jobs/thinexecutions/name
_links.jobs/thinexecutions/name.templated
Boolean
Link jobs/executions/name is templated
_links.jobs/thinexecutions/jobInstanceId.href
String
Link to the jobs/thinexecutions/jobInstanceId
_links.jobs/thinexecutions/jobInstanceId.templated
Boolean
Link jobs/executions/jobInstanceId is templated
_links.jobs/thinexecutions/taskExecutionId.href
String
Link to the jobs/thinexecutions/taskExecutionId
_links.jobs/thinexecutions/taskExecutionId.templated
Boolean
Link jobs/executions/taskExecutionId is templated
_links.jobs/executions/execution.href
String
Link to the jobs/executions/execution
_links.jobs/executions/execution.templated
Boolean
Link jobs/executions/execution is templated
_links.jobs/executions/execution/steps.href
String
Link to the jobs/executions/execution/steps
_links.jobs/executions/execution/steps.templated
Boolean
Link jobs/executions/execution/steps is templated
_links.jobs/executions/execution/steps/step.href
String
Link to the jobs/executions/execution/steps/step
_links.jobs/executions/execution/steps/step.templated
Boolean
Link jobs/executions/execution/steps/step is templated
_links.jobs/executions/execution/steps/step/progress.href
String
Link to the jobs/executions/execution/steps/step/progress
_links.jobs/executions/execution/steps/step/progress.templated
Boolean
Link jobs/executions/execution/steps/step/progress is templated
_links.jobs/instances/name.href
String
Link to the jobs/instances/name
_links.jobs/instances/name.templated
Boolean
Link jobs/instances/name is templated
_links.jobs/instances/instance.href
String
Link to the jobs/instances/instance
_links.jobs/instances/instance.templated
Boolean
Link jobs/instances/instance is templated
_links.tools/parseTaskTextToGraph.href
String
Link to the tools/parseTaskTextToGraph
_links.tools/convertTaskGraphToText.href
String
Link to the tools/convertTaskGraphToText
_links.apps.href
String
Link to the apps
_links.about.href
String
Link to the about
_links.completions/stream.href
String
Link to the completions/stream
_links.completions/stream.templated
Boolean
Link completions/stream is templated
_links.completions/task.href
String
Link to the completions/task
_links.completions/task.templated
Boolean
Link completions/task is templated
"href" : "http://localhost:9393/streams/definitions"
"streams/definitions/definition" : {
"href" : "http://localhost:9393/streams/definitions/{name}",
"templated" : true
"streams/validation" : {
"href" : "http://localhost:9393/streams/validation/{name}",
"templated" : true
"runtime/streams" : {
"href" : "http://localhost:9393/runtime/streams{?names}",
"templated" : true
"runtime/streams/{streamNames}" : {
"href" : "http://localhost:9393/runtime/streams/{streamNames}",
"templated" : true
"runtime/apps" : {
"href" : "http://localhost:9393/runtime/apps"
"runtime/apps/{appId}" : {
"href" : "http://localhost:9393/runtime/apps/{appId}",
"templated" : true
"runtime/apps/{appId}/instances" : {
"href" : "http://localhost:9393/runtime/apps/{appId}/instances",
"templated" : true
"runtime/apps/{appId}/instances/{instanceId}" : {
"href" : "http://localhost:9393/runtime/apps/{appId}/instances/{instanceId}",
"templated" : true
"runtime/apps/{appId}/instances/{instanceId}/actuator" : [ {
"href" : "http://localhost:9393/runtime/apps/{appId}/instances/{instanceId}/actuator?endpoint={endpoint}",
"templated" : true
"href" : "http://localhost:9393/runtime/apps/{appId}/instances/{instanceId}/actuator",
"templated" : true
"runtime/apps/{appId}/instances/{instanceId}/post" : {
"href" : "http://localhost:9393/runtime/apps/{appId}/instances/{instanceId}/post",
"templated" : true
"streams/deployments" : {
"href" : "http://localhost:9393/streams/deployments"
"streams/deployments/{name}{?reuse-deployment-properties}" : {
"href" : "http://localhost:9393/streams/deployments/{name}?reuse-deployment-properties=false",
"templated" : true
"streams/deployments/{name}" : {
"href" : "http://localhost:9393/streams/deployments/{name}",
"templated" : true
"streams/deployments/history/{name}" : {
"href" : "http://localhost:9393/streams/deployments/history/{name}",
"templated" : true
"streams/deployments/manifest/{name}/{version}" : {
"href" : "http://localhost:9393/streams/deployments/manifest/{name}/{version}",
"templated" : true
"streams/deployments/platform/list" : {
"href" : "http://localhost:9393/streams/deployments/platform/list"
"streams/deployments/rollback/{name}/{version}" : {
"href" : "http://localhost:9393/streams/deployments/rollback/{name}/{version}",
"templated" : true
"streams/deployments/update/{name}" : {
"href" : "http://localhost:9393/streams/deployments/update/{name}",
"templated" : true
"streams/deployments/deployment" : {
"href" : "http://localhost:9393/streams/deployments/{name}",
"templated" : true
"streams/deployments/scale/{streamName}/{appName}/instances/{count}" : {
"href" : "http://localhost:9393/streams/deployments/scale/{streamName}/{appName}/instances/{count}",
"templated" : true
"streams/logs" : {
"href" : "http://localhost:9393/streams/logs"
"streams/logs/{streamName}" : {
"href" : "http://localhost:9393/streams/logs/{streamName}",
"templated" : true
"streams/logs/{streamName}/{appName}" : {
"href" : "http://localhost:9393/streams/logs/{streamName}/{appName}",
"templated" : true
"tasks/platforms" : {
"href" : "http://localhost:9393/tasks/platforms"
"tasks/definitions" : {
"href" : "http://localhost:9393/tasks/definitions"
"tasks/definitions/definition" : {
"href" : "http://localhost:9393/tasks/definitions/{name}",
"templated" : true
"tasks/executions" : {
"href" : "http://localhost:9393/tasks/executions"
"tasks/executions/name" : {
"href" : "http://localhost:9393/tasks/executions{?name}",
"templated" : true
"tasks/executions/current" : {
"href" : "http://localhost:9393/tasks/executions/current"
"tasks/executions/execution" : {
"href" : "http://localhost:9393/tasks/executions/{id}",
"templated" : true
"tasks/validation" : {
"href" : "http://localhost:9393/tasks/validation/{name}",
"templated" : true
"tasks/info/executions" : {
"href" : "http://localhost:9393/tasks/info/executions{?completed,name}",
"templated" : true
"tasks/logs" : {
"href" : "http://localhost:9393/tasks/logs/{taskExternalExecutionId}{?platformName}",
"templated" : true
"tasks/schedules" : {
"href" : "http://localhost:9393/tasks/schedules"
"tasks/schedules/instances" : {
"href" : "http://localhost:9393/tasks/schedules/instances/{taskDefinitionName}",
"templated" : true
"jobs/executions" : {
"href" : "http://localhost:9393/jobs/executions"
"jobs/executions/name" : {
"href" : "http://localhost:9393/jobs/executions{?name}",
"templated" : true
"jobs/executions/status" : {
"href" : "http://localhost:9393/jobs/executions{?status}",
"templated" : true
"jobs/executions/execution" : {
"href" : "http://localhost:9393/jobs/executions/{id}",
"templated" : true
"jobs/executions/execution/steps" : {
"href" : "http://localhost:9393/jobs/executions/{jobExecutionId}/steps",
"templated" : true
"jobs/executions/execution/steps/step" : {
"href" : "http://localhost:9393/jobs/executions/{jobExecutionId}/steps/{stepId}",
"templated" : true
"jobs/executions/execution/steps/step/progress" : {
"href" : "http://localhost:9393/jobs/executions/{jobExecutionId}/steps/{stepId}/progress",
"templated" : true
"jobs/instances/name" : {
"href" : "http://localhost:9393/jobs/instances{?name}",
"templated" : true
"jobs/instances/instance" : {
"href" : "http://localhost:9393/jobs/instances/{id}",
"templated" : true
"tools/parseTaskTextToGraph" : {
"href" : "http://localhost:9393/tools"
"tools/convertTaskGraphToText" : {
"href" : "http://localhost:9393/tools"
"jobs/thinexecutions" : {
"href" : "http://localhost:9393/jobs/thinexecutions"
"jobs/thinexecutions/name" : {
"href" : "http://localhost:9393/jobs/thinexecutions{?name}",
"templated" : true
"jobs/thinexecutions/jobInstanceId" : {
"href" : "http://localhost:9393/jobs/thinexecutions{?jobInstanceId}",
"templated" : true
"jobs/thinexecutions/taskExecutionId" : {
"href" : "http://localhost:9393/jobs/thinexecutions{?taskExecutionId}",
"templated" : true
"apps" : {
"href" : "http://localhost:9393/apps"
"about" : {
"href" : "http://localhost:9393/about"
"completions/stream" : {
"href" : "http://localhost:9393/completions/stream{?start,detailLevel}",
"templated" : true
"completions/task" : {
"href" : "http://localhost:9393/completions/task{?start,detailLevel}",
"templated" : true
"api.revision" : 14
about
Access meta information, including enabled features, security info, version information
dashboard
Access the dashboard UI
audit-records
Provides audit trail information
Handle registered applications
completions/stream
Exposes the DSL completion features for Stream
completions/task
Exposes the DSL completion features for Task
jobs/executions
Provides the JobExecution resource
jobs/thinexecutions
Provides the JobExecution thin resource with no step executions included
jobs/executions/execution
Provides details for a specific JobExecution
jobs/executions/execution/steps
Provides the steps for a JobExecution
jobs/executions/execution/steps/step
Returns the details for a specific step
jobs/executions/execution/steps/step/progress
Provides progress information for a specific step
jobs/executions/name
Retrieve Job Executions by Job name
jobs/executions/status
Retrieve Job Executions by Job status
jobs/thinexecutions/name
Retrieve Job Executions by Job name with no step executions included
jobs/thinexecutions/jobInstanceId
Retrieve Job Executions by Job Instance Id with no step executions included
jobs/thinexecutions/taskExecutionId
Retrieve Job Executions by Task Execution Id with no step executions included
jobs/instances/instance
Provides the job instance resource for a specific job instance
jobs/instances/name
Provides the Job instance resource for a specific job name
runtime/streams
Exposes stream runtime status
runtime/streams/{streamNames}
Exposes streams runtime status for a given stream names
runtime/apps
Provides the runtime application resource
runtime/apps/{appId}
Exposes the runtime status for a specific app
runtime/apps/{appId}/instances
Provides the status for app instances
runtime/apps/{appId}/instances/{instanceId}
Provides the status for specific app instance
runtime/apps/{appId}/instances/{instanceId}/actuator
EXPERIMENTAL: Allows invoking Actuator endpoint on specific app instance
runtime/apps/{appId}/instances/{instanceId}/post
EXPERIMENTAL: Allows POST on http sink
tasks/definitions
Provides the task definition resource
tasks/definitions/definition
Provides details for a specific task definition
tasks/validation
Provides the validation for a task definition
tasks/executions
Returns Task executions and allows launching of tasks
tasks/executions/current
Provides the current count of running tasks
tasks/info/executions
Provides the task executions info
tasks/schedules
Provides schedule information of tasks
tasks/schedules/instances
Provides schedule information of a specific task
tasks/executions/name
Returns all task executions for a given Task name
tasks/executions/execution
Provides details for a specific task execution
tasks/platforms
Provides platform accounts for launching tasks. The results can be filtered to show the platforms that support scheduling by adding a request parameter of 'schedulesEnabled=true
tasks/logs
Retrieve the task application log
schema/versions
List of Spring Boot related schemas
schema/targets
List of schema targets
streams/definitions
Exposes the Streams resource
streams/definitions/definition
Handle a specific Stream definition
streams/validation
Provides the validation for a stream definition
streams/deployments
Provides Stream deployment operations
streams/deployments/{name}
Request deployment info for a stream definition
streams/deployments/{name}{?reuse-deployment-properties}
Request deployment info for a stream definition
streams/deployments/deployment
Request (un-)deployment of an existing stream definition
streams/deployments/manifest/{name}/{version}
Return a manifest info of a release version
streams/deployments/history/{name}
Get stream’s deployment history as list or Releases for this release
streams/deployments/rollback/{name}/{version}
Rollback the stream to the previous or a specific version of the stream
streams/deployments/update/{name}
Update the stream.
streams/deployments/platform/list
List of supported deployment platforms
streams/deployments/scale/{streamName}/{appName}/instances/{count}
Scale up or down number of application instances for a selected stream
streams/logs
Retrieve application logs of the stream
streams/logs/{streamName}
Retrieve application logs of the stream
streams/logs/{streamName}/{appName}
Retrieve a specific application log of the stream
tools/parseTaskTextToGraph
Parse a task definition into a graph structure
tools/convertTaskGraphToText
Convert a graph format into DSL text format
42.2. Server Meta Information
The server meta information endpoint provides more information about the server itself.
The following topics provide more details:
"name" : "Spring Cloud Data Flow Shell",
"version" : "2.11.0",
"url" : "https://repo.maven.apache.org/maven2/org/springframework/cloud/spring-cloud-dataflow-shell/2.11.0/spring-cloud-dataflow-shell-2.11.0.jar"
"securityInfo" : {
"authenticationEnabled" : false,
"authenticated" : false,
"username" : null,
"roles" : [ ]
"runtimeEnvironment" : {
"appDeployer" : {
"deployerImplementationVersion" : "Test Version",
"deployerName" : "Test Server",
"deployerSpiVersion" : "2.11.0",
"javaVersion" : "1.8.0_372",
"platformApiVersion" : "",
"platformClientVersion" : "",
"platformHostVersion" : "",
"platformSpecificInfo" : {
"default" : "local"
"platformType" : "Skipper Managed",
"springBootVersion" : "2.7.10",
"springVersion" : "5.3.26"
"taskLaunchers" : [ {
"deployerImplementationVersion" : "unknown",
"deployerName" : "LocalTaskLauncher",
"deployerSpiVersion" : "unknown",
"javaVersion" : "1.8.0_372",
"platformApiVersion" : "Linux 5.15.0-1036-azure",
"platformClientVersion" : "5.15.0-1036-azure",
"platformHostVersion" : "5.15.0-1036-azure",
"platformSpecificInfo" : { },
"platformType" : "Local",
"springBootVersion" : "2.7.10",
"springVersion" : "5.3.26"
"deployerImplementationVersion" : "unknown",
"deployerName" : "LocalTaskLauncher",
"deployerSpiVersion" : "unknown",
"javaVersion" : "1.8.0_372",
"platformApiVersion" : "Linux 5.15.0-1036-azure",
"platformClientVersion" : "5.15.0-1036-azure",
"platformHostVersion" : "5.15.0-1036-azure",
"platformSpecificInfo" : { },
"platformType" : "Local",
"springBootVersion" : "2.7.10",
"springVersion" : "5.3.26"
"monitoringDashboardInfo" : {
"url" : "",
"refreshInterval" : 15,
"dashboardType" : "NONE",
"source" : "default-scdf-source"
"_links" : {
"self" : {
"href" : "http://localhost:9393/about"
42.3. Registered Applications
The registered applications endpoint provides information about the applications that are registered with the Spring Cloud Data Flow server.
The following topics provide more details:
42.3.1. Listing Applications
A GET
request lists all of the applications known to Spring Cloud Data Flow.
The following topics provide more details:
GET /apps?search=&type=source&defaultVersion=true&page=0&size=10&sort=name%2CASC HTTP/1.1
Accept: application/json
Host: localhost:9393
Restrict the returned apps to the type of the app. One of [app, source, processor, sink, task]
defaultVersion
The boolean flag to set to retrieve only the apps of the default versions (optional)
The zero-based page number (optional)
The sort on the list (optional)
The requested page size (optional)
$ curl 'http://localhost:9393/apps?search=&type=source&defaultVersion=true&page=0&size=10&sort=name%2CASC' -i -X GET \
-H 'Accept: application/json'
"name" : "http",
"type" : "source",
"uri" : "maven://org.springframework.cloud.stream.app:http-source-rabbit:1.2.0.RELEASE",
"version" : "1.2.0.RELEASE",
"defaultVersion" : true,
"bootVersion" : "2",
"versions" : [ "1.2.0.RELEASE" ],
"label" : null,
"_links" : {
"self" : {
"href" : "http://localhost:9393/apps/source/http/1.2.0.RELEASE"
"name" : "time",
"type" : "source",
"uri" : "maven://org.springframework.cloud.stream.app:time-source-rabbit:1.2.0.RELEASE",
"version" : "1.2.0.RELEASE",
"defaultVersion" : true,
"bootVersion" : "2",
"versions" : [ "1.2.0.RELEASE" ],
"label" : null,
"_links" : {
"self" : {
"href" : "http://localhost:9393/apps/source/time/1.2.0.RELEASE"
"_links" : {
"self" : {
"href" : "http://localhost:9393/apps?page=0&size=10&sort=name,asc"
"page" : {
"size" : 10,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
42.3.2. Getting Information on a Particular Application
A GET
request on /apps/<type>/<name>
gets info on a particular application.
The following topics provide more details:
"name" : "http",
"type" : "source",
"uri" : "maven://org.springframework.cloud.stream.app:http-source-rabbit:1.2.0.RELEASE",
"version" : "1.2.0.RELEASE",
"defaultVersion" : true,
"bootVersion" : "2",
"versions" : null,
"label" : null,
"options" : [ {
"id" : "http.path-pattern",
"name" : "path-pattern",
"type" : "java.lang.String",
"description" : "An Ant-Style pattern to determine which http requests will be captured.",
"shortDescription" : "An Ant-Style pattern to determine which http requests will be captured.",
"defaultValue" : "/",
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
"deprecation" : null,
"deprecated" : false
"id" : "http.mapped-request-headers",
"name" : "mapped-request-headers",
"type" : "java.lang.String[]",
"description" : "Headers that will be mapped.",
"shortDescription" : "Headers that will be mapped.",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
"deprecation" : null,
"deprecated" : false
"id" : "http.secured",
"name" : "secured",
"type" : "java.lang.Boolean",
"description" : "Secure or not HTTP source path.",
"shortDescription" : "Secure or not HTTP source path.",
"defaultValue" : false,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
"deprecation" : null,
"deprecated" : false
"id" : "server.port",
"name" : "port",
"type" : "java.lang.Integer",
"description" : "Server HTTP port.",
"shortDescription" : "Server HTTP port.",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
"deprecation" : null,
"deprecated" : false
"shortDescription" : null,
"inboundPortNames" : [ ],
"outboundPortNames" : [ ],
"optionGroups" : { }
42.3.3. Registering a New Application
A POST
request on /apps/<type>/<name>
allows registration of a new application.
The following topics provide more details:
POST /apps/source/http HTTP/1.1
Host: localhost:9393
Content-Type: application/x-www-form-urlencoded
uri=maven%3A%2F%2Forg.springframework.cloud.stream.app%3Ahttp-source-rabbit%3A1.1.0.RELEASE
42.3.4. Registering a New Application with version
A POST
request on /apps/<type>/<name>/<version>
allows registration of a new application.
The following topics provide more details:
POST /apps/source/http/1.1.0.RELEASE HTTP/1.1
Host: localhost:9393
Content-Type: application/x-www-form-urlencoded
uri=maven%3A%2F%2Forg.springframework.cloud.stream.app%3Ahttp-source-rabbit%3A1.1.0.RELEASE
The type of application to register. One of [app, source, processor, sink, task] (optional)
The name of the application to register
version
The version of the application to register
42.3.5. Registering Applications in Bulk
A POST
request on /apps
allows registering multiple applications at once.
The following topics provide more details:
URI where a properties file containing registrations can be fetched. Exclusive with apps
.
Inline set of registrations. Exclusive with uri
.
force
Must be true if a registration with the same name and type already exists, otherwise an error will occur
"name" : "http",
"type" : "source",
"uri" : "maven://org.springframework.cloud.stream.app:http-source-rabbit:1.1.0.RELEASE",
"version" : "1.1.0.RELEASE",
"defaultVersion" : true,
"bootVersion" : "2",
"versions" : null,
"label" : null,
"_links" : {
"self" : {
"href" : "http://localhost:9393/apps/source/http/1.1.0.RELEASE"
"_links" : {
"self" : {
"href" : "http://localhost:9393/apps?page=0&size=20"
"page" : {
"size" : 20,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
42.3.6. Set the Default Application Version
For an application with the same name
and type
, you can register multiple versions.
In this case, you can choose one of the versions as the default application.
The following topics provide more details:
42.3.7. Unregistering an Application
A DELETE
request on /apps/<type>/<name>
unregisters a previously registered application.
The following topics provide more details:
42.3.8. Unregistering all Applications
A DELETE
request on /apps
unregisters all the applications.
The following topics provide more details:
42.4.1. List All Audit Records
The audit records endpoint lets you retrieve audit trail information.
The following topics provide more details:
GET /audit-records?page=0&size=10&operations=STREAM&actions=CREATE&fromDate=2000-01-01T00%3A00%3A00&toDate=2099-01-01T00%3A00%3A00 HTTP/1.1
Host: localhost:9393
"createdBy" : null,
"correlationId" : "timelog",
"auditData" : "time --format='YYYY MM DD' | log",
"createdOn" : "2023-05-04T00:03:10.201Z",
"auditAction" : "CREATE",
"auditOperation" : "STREAM",
"platformName" : null,
"_links" : {
"self" : {
"href" : "http://localhost:9393/audit-records/5"
"_links" : {
"self" : {
"href" : "http://localhost:9393/audit-records?page=0&size=10"
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
"createdBy" : null,
"correlationId" : "timelog",
"auditData" : "time --format='YYYY MM DD' | log",
"createdOn" : "2023-05-04T00:03:10.201Z",
"auditAction" : "CREATE",
"auditOperation" : "STREAM",
"platformName" : null,
"_links" : {
"self" : {
"href" : "http://localhost:9393/audit-records/5"
"description" : "Create an Entity",
"key" : "CREATE",
"nameWithDescription" : "Create (Create an Entity)"
"id" : 200,
"name" : "Delete",
"description" : "Delete an Entity",
"key" : "DELETE",
"nameWithDescription" : "Delete (Delete an Entity)"
"id" : 300,
"name" : "Deploy",
"description" : "Deploy an Entity",
"key" : "DEPLOY",
"nameWithDescription" : "Deploy (Deploy an Entity)"
"id" : 400,
"name" : "Rollback",
"description" : "Rollback an Entity",
"key" : "ROLLBACK",
"nameWithDescription" : "Rollback (Rollback an Entity)"
"id" : 500,
"name" : "Undeploy",
"description" : "Undeploy an Entity",
"key" : "UNDEPLOY",
"nameWithDescription" : "Undeploy (Undeploy an Entity)"
"id" : 600,
"name" : "Update",
"description" : "Update an Entity",
"key" : "UPDATE",
"nameWithDescription" : "Update (Update an Entity)"
"id" : 700,
"name" : "SuccessfulLogin",
"description" : "Successful login",
"key" : "LOGIN_SUCCESS",
"nameWithDescription" : "SuccessfulLogin (Successful login)"
42.5. Stream Definitions
The registered applications endpoint provides information about the stream definitions that are registered with the Spring Cloud Data Flow server.
The following topics provide more details:
42.5.1. Creating a New Stream Definition
Creating a stream definition is achieved by creating a POST request to the stream definitions endpoint.
A curl request for a ticktock
stream might resemble the following:
A stream definition can also contain additional parameters.
For instance, in the example shown under “Request Structure”, we also provide the date-time format.
The following topics provide more details:
POST /streams/definitions HTTP/1.1
Host: localhost:9393
Content-Type: application/x-www-form-urlencoded
name=timelog&definition=time+--format%3D%27YYYY+MM+DD%27+%7C+log&description=Demo+stream+for+testing&deploy=false
"name" : "timelog",
"dslText" : "time --format='YYYY MM DD' | log",
"originalDslText" : "time --format='YYYY MM DD' | log",
"status" : "undeployed",
"description" : "Demo stream for testing",
"statusDescription" : "The app or group is known to the system, but is not currently deployed",
"_links" : {
"self" : {
"href" : "http://localhost:9393/streams/definitions/timelog"
42.5.2. List All Stream Definitions
The streams endpoint lets you list all the stream definitions.
The following topics provide more details:
"status" : "undeployed",
"description" : "",
"statusDescription" : "The app or group is known to the system, but is not currently deployed",
"_links" : {
"self" : {
"href" : "http://localhost:9393/streams/definitions/mysamplestream"
"name" : "timelog",
"dslText" : "time --format='YYYY MM DD' | log",
"originalDslText" : "time --format='YYYY MM DD' | log",
"status" : "undeployed",
"description" : "Demo stream for testing",
"statusDescription" : "The app or group is known to the system, but is not currently deployed",
"_links" : {
"self" : {
"href" : "http://localhost:9393/streams/definitions/timelog"
"_links" : {
"self" : {
"href" : "http://localhost:9393/streams/definitions?page=0&size=10&sort=name,asc"
"page" : {
"size" : 10,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
42.5.3. List Related Stream Definitions
The streams endpoint lets you list related stream definitions.
The following topics provide more details:
GET /streams/definitions/timelog/related?page=0&sort=name%2CASC&search=&size=10&nested=true HTTP/1.1
Host: localhost:9393
nested
Should we recursively findByTaskNameContains for related stream definitions (optional)
The zero-based page number (optional)
search
The search string performed on the name (optional)
The sort on the list (optional)
The requested page size (optional)
"streamDefinitionResourceList" : [ {
"name" : "timelog",
"dslText" : "time --format='YYYY MM DD' | log",
"originalDslText" : "time --format='YYYY MM DD' | log",
"status" : "undeployed",
"description" : "Demo stream for testing",
"statusDescription" : "The app or group is known to the system, but is not currently deployed",
"_links" : {
"self" : {
"href" : "http://localhost:9393/streams/definitions/timelog"
"_links" : {
"self" : {
"href" : "http://localhost:9393/streams/definitions/timelog/related?page=0&size=10&sort=name,asc"
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
42.5.4. Retrieve Stream Definition Detail
The stream definition endpoint lets you get a single stream definition.
The following topics provide more details:
"name" : "timelog",
"dslText" : "time --format='YYYY MM DD' | log",
"originalDslText" : "time --format='YYYY MM DD' | log",
"status" : "undeployed",
"description" : "Demo stream for testing",
"statusDescription" : "The app or group is known to the system, but is not currently deployed",
"_links" : {
"self" : {
"href" : "http://localhost:9393/streams/definitions/timelog"
42.5.5. Delete a Single Stream Definition
The streams endpoint lets you delete a single stream definition.
(See also: Delete All Stream Definitions.)
The following topics provide more details:
42.5.6. Delete All Stream Definitions
The streams endpoint lets you delete all single stream definitions.
(See also: Delete a Single Stream Definition.)
The following topics provide more details:
42.6. Stream Validation
The stream validation endpoint lets you validate the apps in a stream definition.
The following topics provide more details:
"appName" : "timelog",
"dsl" : "time --format='YYYY MM DD' | log",
"description" : "Demo stream for testing",
"appStatuses" : {
"source:time" : "valid",
"sink:log" : "valid"
42.7. Stream Deployments
The deployment definitions endpoint provides information about the deployments that are registered with the Spring Cloud Data Flow server.
The following topics provide more details:
42.7.1. Deploying Stream Definition
The stream definition endpoint lets you deploy a single stream definition.
Optionally, you can pass application parameters as properties in the request body.
The following topics provide more details:
POST /streams/deployments/timelog HTTP/1.1
Content-Type: application/json
Content-Length: 36
Host: localhost:9393
{"app.time.timestamp.format":"YYYY"}
/streams/deployments/{timelog}
$ curl 'http://localhost:9393/streams/deployments/timelog' -i -X POST \
-H 'Content-Type: application/json' \
-d '{"app.time.timestamp.format":"YYYY"}'
42.7.2. Undeploy Stream Definition
The stream definition endpoint lets you undeploy a single stream definition.
The following topics provide more details:
42.7.3. Undeploy All Stream Definitions
The stream definition endpoint lets you undeploy all single stream definitions.
The following topics provide more details:
POST /streams/deployments/update/timelog1 HTTP/1.1
Content-Type: application/json
Content-Length: 196
Host: localhost:9393
{"releaseName":"timelog1","packageIdentifier":{"repositoryName":"test","packageName":"timelog1","packageVersion":"1.0.0"},"updateProperties":{"app.time.timestamp.format":"YYYYMMDD"},"force":false}
/streams/deployments/update/{timelog1}
$ curl 'http://localhost:9393/streams/deployments/update/timelog1' -i -X POST \
-H 'Content-Type: application/json' \
-d '{"releaseName":"timelog1","packageIdentifier":{"repositoryName":"test","packageName":"timelog1","packageVersion":"1.0.0"},"updateProperties":{"app.time.timestamp.format":"YYYYMMDD"},"force":false}'
42.7.9. Scale Stream Definition
The stream definition endpoint lets you scale a single app in a stream definition.
Optionally, you can pass application parameters as properties in the request body.
The following topics provide more details:
POST /streams/deployments/scale/timelog/log/instances/1 HTTP/1.1
Content-Type: application/json
Content-Length: 36
Host: localhost:9393
{"app.time.timestamp.format":"YYYY"}
/streams/deployments/scale/{streamName}/{appName}/instances/{count}
$ curl 'http://localhost:9393/streams/deployments/scale/timelog/log/instances/1' -i -X POST \
-H 'Content-Type: application/json' \
-d '{"app.time.timestamp.format":"YYYY"}'
42.8. Task Definitions
The task definitions endpoint provides information about the task definitions that are registered with the Spring Cloud Data Flow server.
The following topics provide more details:
42.8.1. Creating a New Task Definition
The task definition endpoint lets you create a new task definition.
The following topics provide more details:
POST /tasks/definitions HTTP/1.1
Host: localhost:9393
Content-Type: application/x-www-form-urlencoded
name=my-task&definition=timestamp+--format%3D%27YYYY+MM+DD%27&description=Demo+task+definition+for+testing
"name" : "my-task",
"dslText" : "timestamp --format='YYYY MM DD'",
"description" : "Demo task definition for testing",
"composed" : false,
"composedTaskElement" : false,
"lastTaskExecution" : null,
"status" : "UNKNOWN",
"_links" : {
"self" : {
"href" : "http://localhost:9393/tasks/definitions/my-task"
42.8.2. List All Task Definitions
The task definition endpoint lets you get all task definitions.
The following topics provide more details:
"taskDefinitionResourceList" : [ {
"name" : "my-task",
"dslText" : "timestamp --format='YYYY MM DD'",
"description" : "Demo task definition for testing",
"composed" : false,
"composedTaskElement" : false,
"lastTaskExecution" : null,
"status" : "UNKNOWN",
"_links" : {
"self" : {
"href" : "http://localhost:9393/tasks/definitions/my-task"
"_links" : {
"self" : {
"href" : "http://localhost:9393/tasks/definitions?page=0&size=10&sort=taskName,asc"
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
42.8.3. Retrieve Task Definition Detail
The task definition endpoint lets you get a single task definition.
The following topics provide more details:
"name" : "my-task",
"dslText" : "timestamp --format='YYYY MM DD'",
"description" : "Demo task definition for testing",
"composed" : false,
"composedTaskElement" : false,
"lastTaskExecution" : null,
"status" : "UNKNOWN",
"_links" : {
"self" : {
"href" : "http://localhost:9393/tasks/definitions/my-task"
42.8.4. Delete Task Definition
The task definition endpoint lets you delete a single task definition.
The following topics provide more details:
42.9. Task Scheduler
The task scheduler endpoint provides information about the task schedules that are registered with the Scheduler Implementation.
The following topics provide more details:
42.9.1. Creating a New Task Schedule
The task schedule endpoint lets you create a new task schedule.
The following topics provide more details:
POST /tasks/schedules HTTP/1.1
Host: localhost:9393
Content-Type: application/x-www-form-urlencoded
scheduleName=myschedule&taskDefinitionName=mytaskname&platform=default&properties=scheduler.cron.expression%3D00+22+17+%3F+*&arguments=--foo%3Dbar
"taskDefinitionName" : "BAR",
"scheduleProperties" : {
"scheduler.AAA.spring.cloud.scheduler.cron.expression" : "00 41 17 ? * *"
"_links" : {
"self" : {
"href" : "http://localhost:9393/tasks/schedules/FOO"
"_links" : {
"self" : {
"href" : "http://localhost:9393/tasks/schedules?page=0&size=10"
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
42.9.3. List Filtered Schedules
The task schedules endpoint lets you get all task schedules that have the specified task definition name.
The following topics provide more details:
"taskDefinitionName" : "BAR",
"scheduleProperties" : {
"scheduler.AAA.spring.cloud.scheduler.cron.expression" : "00 41 17 ? * *"
"_links" : {
"self" : {
"href" : "http://localhost:9393/tasks/schedules/FOO"
"_links" : {
"self" : {
"href" : "http://localhost:9393/tasks/schedules/instances/FOO?page=0&size=1"
"page" : {
"size" : 1,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
42.9.4. Delete Task Schedule
The task schedule endpoint lets you delete a single task schedule.
The following topics provide more details:
42.10. Task Validation
The task validation endpoint lets you validate the apps in a task definition.
The following topics provide more details:
42.11. Task Executions
The task executions endpoint provides information about the task executions that are registered with the Spring Cloud Data Flow server.
The following topics provide more details:
42.11.1. Launching a Task
Launching a task is done by requesting the creation of a new task execution.
The following topics provide more details:
POST /tasks/executions HTTP/1.1
Host: localhost:9393
Content-Type: application/x-www-form-urlencoded
name=taskA&properties=app.my-task.foo%3Dbar%2Cdeployer.my-task.something-else%3D3&arguments=--server.port%3D8080+--foo%3Dbar
42.11.2. Stopping a Task
Stopping a task is done by posting the id of an existing task execution.
The following topics provide more details:
POST /tasks/executions/1 HTTP/1.1
Host: localhost:9393
Content-Type: application/x-www-form-urlencoded
platform=default
42.11.3. List All Task Executions
The task executions endpoint lets you list all task executions.
The following topics provide more details:
"jobExecutionIds" : [ ],
"errorMessage" : null,
"externalExecutionId" : "taskB-751ce929-7aed-49e3-977d-e08ced094236",
"parentExecutionId" : null,
"resourceUrl" : "org.springframework.cloud.task.app:timestamp-task:jar:1.2.0.RELEASE",
"appProperties" : {
"management.metrics.tags.service" : "task-application",
"timestamp.format" : "yyyy MM dd",
"spring.datasource.username" : null,
"spring.datasource.url" : null,
"spring.datasource.driverClassName" : null,
"management.metrics.tags.application" : "${spring.cloud.task.name:unknown}-${spring.cloud.task.executionid:unknown}",
"spring.cloud.task.name" : "taskB"
"deploymentProperties" : {
"app.my-task.foo" : "bar",
"deployer.my-task.something-else" : "3"
"platformName" : "default",
"taskExecutionStatus" : "UNKNOWN",
"_links" : {
"tasks/logs" : {
"href" : "http://localhost:9393/tasks/logs/taskB-751ce929-7aed-49e3-977d-e08ced094236?platformName=default"
"self" : {
"href" : "http://localhost:9393/tasks/executions/2"
"executionId" : 1,
"exitCode" : null,
"taskName" : "taskA",
"startTime" : null,
"endTime" : null,
"exitMessage" : null,
"arguments" : [ ],
"jobExecutionIds" : [ ],
"errorMessage" : null,
"externalExecutionId" : "taskA-7d9b84f8-1192-4910-92e5-bb8e3ea6474d",
"parentExecutionId" : null,
"resourceUrl" : "org.springframework.cloud.task.app:timestamp-task:jar:1.2.0.RELEASE",
"appProperties" : {
"management.metrics.tags.service" : "task-application",
"timestamp.format" : "yyyy MM dd",
"spring.datasource.username" : null,
"spring.datasource.url" : null,
"spring.datasource.driverClassName" : null,
"management.metrics.tags.application" : "${spring.cloud.task.name:unknown}-${spring.cloud.task.executionid:unknown}",
"spring.cloud.task.name" : "taskA"
"deploymentProperties" : {
"app.my-task.foo" : "bar",
"deployer.my-task.something-else" : "3"
"platformName" : "default",
"taskExecutionStatus" : "UNKNOWN",
"_links" : {
"tasks/logs" : {
"href" : "http://localhost:9393/tasks/logs/taskA-7d9b84f8-1192-4910-92e5-bb8e3ea6474d?platformName=default"
"self" : {
"href" : "http://localhost:9393/tasks/executions/1"
"_links" : {
"self" : {
"href" : "http://localhost:9393/tasks/executions?page=0&size=10"
"page" : {
"size" : 10,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
42.11.4. List All Task Executions With a Specified Task Name
The task executions endpoint lets you list task executions with a specified task name.
The following topics provide more details:
"jobExecutionIds" : [ ],
"errorMessage" : null,
"externalExecutionId" : "taskB-751ce929-7aed-49e3-977d-e08ced094236",
"parentExecutionId" : null,
"resourceUrl" : "org.springframework.cloud.task.app:timestamp-task:jar:1.2.0.RELEASE",
"appProperties" : {
"management.metrics.tags.service" : "task-application",
"timestamp.format" : "yyyy MM dd",
"spring.datasource.username" : null,
"spring.datasource.url" : null,
"spring.datasource.driverClassName" : null,
"management.metrics.tags.application" : "${spring.cloud.task.name:unknown}-${spring.cloud.task.executionid:unknown}",
"spring.cloud.task.name" : "taskB"
"deploymentProperties" : {
"app.my-task.foo" : "bar",
"deployer.my-task.something-else" : "3"
"platformName" : "default",
"taskExecutionStatus" : "UNKNOWN",
"_links" : {
"tasks/logs" : {
"href" : "http://localhost:9393/tasks/logs/taskB-751ce929-7aed-49e3-977d-e08ced094236?platformName=default"
"self" : {
"href" : "http://localhost:9393/tasks/executions/2"
"_links" : {
"self" : {
"href" : "http://localhost:9393/tasks/executions?page=0&size=10"
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
42.11.5. Task Execution Detail
The task executions endpoint lets you get the details about a task execution.
The following topics provide more details:
"jobExecutionIds" : [ ],
"errorMessage" : null,
"externalExecutionId" : "taskA-7d9b84f8-1192-4910-92e5-bb8e3ea6474d",
"parentExecutionId" : null,
"resourceUrl" : "org.springframework.cloud.task.app:timestamp-task:jar:1.2.0.RELEASE",
"appProperties" : {
"management.metrics.tags.service" : "task-application",
"timestamp.format" : "yyyy MM dd",
"spring.datasource.username" : null,
"spring.datasource.url" : null,
"spring.datasource.driverClassName" : null,
"management.metrics.tags.application" : "${spring.cloud.task.name:unknown}-${spring.cloud.task.executionid:unknown}",
"spring.cloud.task.name" : "taskA"
"deploymentProperties" : {
"app.my-task.foo" : "bar",
"deployer.my-task.something-else" : "3"
"platformName" : "default",
"taskExecutionStatus" : "UNKNOWN",
"_links" : {
"tasks/logs" : {
"href" : "http://localhost:9393/tasks/logs/taskA-7d9b84f8-1192-4910-92e5-bb8e3ea6474d?platformName=default"
"self" : {
"href" : "http://localhost:9393/tasks/executions/1"
The cleanup implementation (first option) is platform specific. Both operations can be triggered
at once or separately.
You must provide task execution IDs that actually exist. Otherwise, a 404
(Not Found) HTTP status is returned.
In the case of submitting multiple task execution IDs, the invalidity of a single task execution ID causes the entire request to fail,
without performing any operation.
Request Parameters
This endpoint supports one optional request parameter named action. It is an enumeration and supports the following
values:
42.11.7. Deleting Task Execution Data
Not only can you clean up resources that were used to deploy tasks but you can also delete the data associated with
task executions from the underlying persistence store. Also, if a task execution is associated with one or
more batch job executions, these are removed as well.
The following example illustrates how a request can be made using multiple task execution IDs and multiple actions:
$ curl 'http://localhost:9393/tasks/executions/1,2?action=CLEANUP,REMOVE_DATA' -i -X DELETE
/tasks/executions/{ids}
When deleting data from the persistence store by using the REMOVE_DATA
action parameter, you must provide
task execution IDs that represent parent task executions. When you provide child task executions (executed as part of a composed task),
a 400
(Bad Request) HTTP status is returned.
When deleting large number of task executions some database types limit the number of entries in the IN
clause (the method Spring Cloud Data Flow uses to delete relationships for task executions).
Spring Cloud Data Flow supports the chunking of deletes for Sql Server (Maximum 2100 entries) and Oracle DBs (Maximum 1000 entries).
However, Spring Cloud Data Flow allows users to set their own chunking factor. To do this set the spring.cloud.dataflow.task.executionDeleteChunkSize
property to the appropriate chunk size.
Default is 0
which means Spring Cloud Data Flow will not chunk the task execution deletes (except for Oracle and Sql Server databases).
42.11.8. Task Execution Current Count
The task executions current endpoint lets you retrieve the current number of running executions.
The following topics provide more details:
42.12. Job Executions
The job executions endpoint provides information about the job executions that are registered with the Spring Cloud Data Flow server.
The following topics provide more details:
List All Job Executions For A Specified Task Execution Id Without Step Executions Included
42.12.1. List All Job Executions
The job executions endpoint lets you list all job executions.
The following topics provide more details:
"stepExecutions" : [ ],
"status" : "STOPPED",
"startTime" : "2023-05-04T00:02:53.589+0000",
"createTime" : "2023-05-04T00:02:53.588+0000",
"endTime" : null,
"lastUpdated" : "2023-05-04T00:02:53.589+0000",
"exitStatus" : {
"exitCode" : "UNKNOWN",
"exitDescription" : ""
"executionContext" : {
"dirty" : false,
"empty" : true,
"values" : [ ]
"failureExceptions" : [ ],
"jobConfigurationName" : null,
"allFailureExceptions" : [ ]
"jobParameters" : { },
"jobParametersString" : "",
"restartable" : true,
"abandonable" : true,
"stoppable" : false,
"defined" : true,
"timeZone" : "UTC",
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/executions/2"
"executionId" : 1,
"stepExecutionCount" : 0,
"jobId" : 1,
"taskExecutionId" : 1,
"name" : "DOCJOB",
"startDate" : "2023-05-04",
"startTime" : "00:02:53",
"duration" : "00:00:00",
"jobExecution" : {
"id" : 1,
"version" : 2,
"jobParameters" : {
"parameters" : { }
"jobInstance" : {
"id" : 1,
"jobName" : "DOCJOB",
"version" : null
"stepExecutions" : [ ],
"status" : "STOPPING",
"startTime" : "2023-05-04T00:02:53.583+0000",
"createTime" : "2023-05-04T00:02:53.569+0000",
"endTime" : null,
"lastUpdated" : "2023-05-04T00:02:53.775+0000",
"exitStatus" : {
"exitCode" : "UNKNOWN",
"exitDescription" : ""
"executionContext" : {
"dirty" : false,
"empty" : true,
"values" : [ ]
"failureExceptions" : [ ],
"jobConfigurationName" : null,
"allFailureExceptions" : [ ]
"jobParameters" : { },
"jobParametersString" : "",
"restartable" : false,
"abandonable" : true,
"stoppable" : false,
"defined" : false,
"timeZone" : "UTC",
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/executions/1"
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/executions?page=0&size=10"
"page" : {
"size" : 10,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
42.12.2. List All Job Executions Without Step Executions Included
The job executions endpoint lets you list all job executions without step executions included.
The following topics provide more details:
"startDate" : "2023-05-04",
"startTime" : "00:02:53",
"startDateTime" : "2023-05-04T00:02:53.589+0000",
"duration" : "00:00:00",
"jobParameters" : { },
"jobParametersString" : "",
"restartable" : true,
"abandonable" : true,
"stoppable" : false,
"defined" : true,
"timeZone" : "UTC",
"status" : "STOPPED",
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/thinexecutions/2"
"executionId" : 1,
"stepExecutionCount" : 0,
"jobId" : 1,
"taskExecutionId" : 1,
"instanceId" : 1,
"name" : "DOCJOB",
"startDate" : "2023-05-04",
"startTime" : "00:02:53",
"startDateTime" : "2023-05-04T00:02:53.583+0000",
"duration" : "00:00:00",
"jobParameters" : { },
"jobParametersString" : "",
"restartable" : false,
"abandonable" : false,
"stoppable" : true,
"defined" : false,
"timeZone" : "UTC",
"status" : "STARTED",
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/thinexecutions/1"
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/thinexecutions?page=0&size=10"
"page" : {
"size" : 10,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
42.12.3. List All Job Executions With a Specified Job Name
The job executions endpoint lets you list all job executions.
The following topics provide more details:
"stepExecutions" : [ ],
"status" : "STOPPING",
"startTime" : "2023-05-04T00:02:53.583+0000",
"createTime" : "2023-05-04T00:02:53.569+0000",
"endTime" : null,
"lastUpdated" : "2023-05-04T00:02:53.775+0000",
"exitStatus" : {
"exitCode" : "UNKNOWN",
"exitDescription" : ""
"executionContext" : {
"dirty" : false,
"empty" : true,
"values" : [ ]
"failureExceptions" : [ ],
"jobConfigurationName" : null,
"allFailureExceptions" : [ ]
"jobParameters" : { },
"jobParametersString" : "",
"restartable" : false,
"abandonable" : true,
"stoppable" : false,
"defined" : false,
"timeZone" : "UTC",
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/executions/1"
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/executions?page=0&size=10"
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
42.12.4. List All Job Executions With a Specified Job Name Without Step Executions Included
The job executions endpoint lets you list all job executions.
The following topics provide more details:
"startDate" : "2023-05-04",
"startTime" : "00:02:53",
"startDateTime" : "2023-05-04T00:02:53.583+0000",
"duration" : "00:00:00",
"jobParameters" : { },
"jobParametersString" : "",
"restartable" : false,
"abandonable" : true,
"stoppable" : false,
"defined" : false,
"timeZone" : "UTC",
"status" : "STOPPING",
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/thinexecutions/1"
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/thinexecutions?page=0&size=10"
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
42.12.5. List All Job Executions For A Specified Date Range Without Step Executions Included
The job executions endpoint lets you list all job executions.
The following topics provide more details:
GET /jobs/thinexecutions?page=0&size=10&fromDate=2000-09-24T17%3A00%3A45%2C000&toDate=2050-09-24T18%3A00%3A45%2C000 HTTP/1.1
Host: localhost:9393
"startDate" : "2023-05-04",
"startTime" : "00:02:53",
"startDateTime" : "2023-05-04T00:02:53.589+0000",
"duration" : "00:00:00",
"jobParameters" : { },
"jobParametersString" : "",
"restartable" : true,
"abandonable" : true,
"stoppable" : false,
"defined" : true,
"timeZone" : "UTC",
"status" : "STOPPED",
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/thinexecutions/2"
"executionId" : 1,
"stepExecutionCount" : 0,
"jobId" : 1,
"taskExecutionId" : 1,
"instanceId" : 1,
"name" : "DOCJOB",
"startDate" : "2023-05-04",
"startTime" : "00:02:53",
"startDateTime" : "2023-05-04T00:02:53.583+0000",
"duration" : "00:00:00",
"jobParameters" : { },
"jobParametersString" : "",
"restartable" : false,
"abandonable" : true,
"stoppable" : false,
"defined" : false,
"timeZone" : "UTC",
"status" : "STOPPING",
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/thinexecutions/1"
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/thinexecutions?page=0&size=10"
"page" : {
"size" : 10,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
42.12.6. List All Job Executions For A Specified Job Instance Id Without Step Executions Included
The job executions endpoint lets you list all job executions.
The following topics provide more details:
"startDate" : "2023-05-04",
"startTime" : "00:02:53",
"startDateTime" : "2023-05-04T00:02:53.583+0000",
"duration" : "00:00:00",
"jobParameters" : { },
"jobParametersString" : "",
"restartable" : false,
"abandonable" : true,
"stoppable" : false,
"defined" : false,
"timeZone" : "UTC",
"status" : "STOPPING",
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/thinexecutions/1"
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/thinexecutions?page=0&size=10"
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
42.12.7. List All Job Executions For A Specified Task Execution Id Without Step Executions Included
The job executions endpoint lets you list all job executions.
The following topics provide more details:
"startDate" : "2023-05-04",
"startTime" : "00:02:53",
"startDateTime" : "2023-05-04T00:02:53.583+0000",
"duration" : "00:00:00",
"jobParameters" : { },
"jobParametersString" : "",
"restartable" : false,
"abandonable" : true,
"stoppable" : false,
"defined" : false,
"timeZone" : "UTC",
"status" : "STOPPING",
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/thinexecutions/1"
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/thinexecutions?page=0&size=10"
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
42.12.8. Job Execution Detail
The job executions endpoint lets you get the details about a job execution.
The following topics provide more details:
"stepExecutions" : [ ],
"status" : "STOPPED",
"startTime" : "2023-05-04T00:02:53.589+0000",
"createTime" : "2023-05-04T00:02:53.588+0000",
"endTime" : null,
"lastUpdated" : "2023-05-04T00:02:53.589+0000",
"exitStatus" : {
"exitCode" : "UNKNOWN",
"exitDescription" : ""
"executionContext" : {
"dirty" : false,
"empty" : true,
"values" : [ ]
"failureExceptions" : [ ],
"jobConfigurationName" : null,
"allFailureExceptions" : [ ]
"jobParameters" : { },
"jobParametersString" : "",
"restartable" : true,
"abandonable" : true,
"stoppable" : false,
"defined" : true,
"timeZone" : "UTC",
"_links" : {
"self" : {
"href" : "http://localhost:9393/jobs/executions/2"
Accept: application/json
Host: localhost:9393
Content-Type: application/x-www-form-urlencoded
stop=true
/jobs/executions/{id}
$ curl 'http://localhost:9393/jobs/executions/1' -i -X PUT \
-H 'Accept: application/json' \
-d 'stop=true'
42.12.10. Restart Job Execution
The job executions endpoint lets you restart a job execution.
The following topics provide more details:
Accept: application/json
Host: localhost:9393
Content-Type: application/x-www-form-urlencoded
restart=true
/jobs/executions/{id}
$ curl 'http://localhost:9393/jobs/executions/2' -i -X PUT \
-H 'Accept: application/json' \
-d 'restart=true'
The job instances endpoint provides information about the job instances that are registered with the Spring Cloud Data Flow server. The following topics provide more details:
The job instances endpoint lets you list all job instances. The following topics provide more details:
"stepExecutions" : [ ], "status" : "STARTED", "startTime" : "2023-05-04T00:00:42.007+0000", "createTime" : "2023-05-04T00:00:41.981+0000", "endTime" : null, "lastUpdated" : "2023-05-04T00:00:42.007+0000", "exitStatus" : { "exitCode" : "UNKNOWN", "exitDescription" : "" "executionContext" : { "dirty" : false, "empty" : true, "values" : [ ] "failureExceptions" : [ ], "jobConfigurationName" : null, "allFailureExceptions" : [ ] "jobParameters" : { }, "jobParametersString" : "", "restartable" : false, "abandonable" : false, "stoppable" : true, "defined" : false, "timeZone" : "UTC" "_links" : { "self" : { "href" : "http://localhost:9393/jobs/instances/1" "_links" : { "self" : { "href" : "http://localhost:9393/jobs/instances?page=0&size=10" "page" : { "size" : 10, "totalElements" : 1, "totalPages" : 1, "number" : 0 "stepExecutions" : [ ], "status" : "STARTED", "startTime" : "2023-05-04T00:00:42.007+0000", "createTime" : "2023-05-04T00:00:41.981+0000", "endTime" : null, "lastUpdated" : "2023-05-04T00:00:42.007+0000", "exitStatus" : { "exitCode" : "UNKNOWN", "exitDescription" : "" "executionContext" : { "dirty" : false, "empty" : true, "values" : [ ] "failureExceptions" : [ ], "jobConfigurationName" : null, "allFailureExceptions" : [ ] "jobParameters" : { }, "jobParametersString" : "", "restartable" : false, "abandonable" : false, "stoppable" : true, "defined" : false, "timeZone" : "UTC" "_links" : { "self" : { "href" : "http://localhost:9393/jobs/instances/1"The job step executions endpoint provides information about the job step executions that are registered with the Spring Cloud Data Flow server. The following topics provide more details:
The job step executions endpoint lets you list all job step executions. The following topics provide more details:
"processSkipCount" : 0, "writeSkipCount" : 0, "startTime" : "2023-05-04T00:03:29.390+0000", "endTime" : null, "lastUpdated" : "2023-05-04T00:03:29.390+0000", "executionContext" : { "dirty" : false, "empty" : true, "values" : [ ] "exitStatus" : { "exitCode" : "EXECUTING", "exitDescription" : "" "terminateOnly" : false, "filterCount" : 0, "failureExceptions" : [ ], "jobParameters" : { "parameters" : { } "jobExecutionId" : 1, "skipCount" : 0, "summary" : "StepExecution: id=1, version=0, name=DOCJOB_STEP, status=STARTING, exitStatus=EXECUTING, readCount=0, filterCount=0, writeCount=0 readSkipCount=0, writeSkipCount=0, processSkipCount=0, commitCount=0, rollbackCount=0" "stepType" : "", "_links" : { "self" : { "href" : "http://localhost:9393/jobs/executions/1/steps/1" "_links" : { "self" : { "href" : "http://localhost:9393/jobs/executions/1/steps?page=0&size=10" "page" : { "size" : 10, "totalElements" : 1, "totalPages" : 1, "number" : 0The job step executions endpoint lets you get details about a job step execution. The following topics provide more details:
"processSkipCount" : 0, "writeSkipCount" : 0, "startTime" : "2023-05-04T00:03:29.390+0000", "endTime" : null, "lastUpdated" : "2023-05-04T00:03:29.390+0000", "executionContext" : { "dirty" : false, "empty" : true, "values" : [ ] "exitStatus" : { "exitCode" : "EXECUTING", "exitDescription" : "" "terminateOnly" : false, "filterCount" : 0, "failureExceptions" : [ ], "jobParameters" : { "parameters" : { } "jobExecutionId" : 1, "skipCount" : 0, "summary" : "StepExecution: id=1, version=0, name=DOCJOB_STEP, status=STARTING, exitStatus=EXECUTING, readCount=0, filterCount=0, writeCount=0 readSkipCount=0, writeSkipCount=0, processSkipCount=0, commitCount=0, rollbackCount=0" "stepType" : "", "_links" : { "self" : { "href" : "http://localhost:9393/jobs/executions/1/steps/1"The job step executions endpoint lets you get details about the progress of a job step execution. The following topics provide more details:
"processSkipCount" : 0, "writeSkipCount" : 0, "startTime" : "2023-05-04T00:03:29.390+0000", "endTime" : null, "lastUpdated" : "2023-05-04T00:03:29.390+0000", "executionContext" : { "dirty" : false, "empty" : true, "values" : [ ] "exitStatus" : { "exitCode" : "EXECUTING", "exitDescription" : "" "terminateOnly" : false, "filterCount" : 0, "failureExceptions" : [ ], "jobParameters" : { "parameters" : { } "jobExecutionId" : 1, "skipCount" : 0, "summary" : "StepExecution: id=1, version=0, name=DOCJOB_STEP, status=STARTING, exitStatus=EXECUTING, readCount=0, filterCount=0, writeCount=0 readSkipCount=0, writeSkipCount=0, processSkipCount=0, commitCount=0, rollbackCount=0" "stepExecutionHistory" : { "stepName" : "DOCJOB_STEP", "count" : 0, "commitCount" : { "count" : 0, "min" : 0.0, "max" : 0.0, "standardDeviation" : 0.0, "mean" : 0.0 "rollbackCount" : { "count" : 0, "min" : 0.0, "max" : 0.0, "standardDeviation" : 0.0, "mean" : 0.0 "readCount" : { "count" : 0, "min" : 0.0, "max" : 0.0, "standardDeviation" : 0.0, "mean" : 0.0 "writeCount" : { "count" : 0, "min" : 0.0, "max" : 0.0, "standardDeviation" : 0.0, "mean" : 0.0 "filterCount" : { "count" : 0, "min" : 0.0, "max" : 0.0, "standardDeviation" : 0.0, "mean" : 0.0 "readSkipCount" : { "count" : 0, "min" : 0.0, "max" : 0.0, "standardDeviation" : 0.0, "mean" : 0.0 "writeSkipCount" : { "count" : 0, "min" : 0.0, "max" : 0.0, "standardDeviation" : 0.0, "mean" : 0.0 "processSkipCount" : { "count" : 0, "min" : 0.0, "max" : 0.0, "standardDeviation" : 0.0, "mean" : 0.0 "duration" : { "count" : 0, "min" : 0.0, "max" : 0.0, "standardDeviation" : 0.0, "mean" : 0.0 "durationPerRead" : { "count" : 0, "min" : 0.0, "max" : 0.0, "standardDeviation" : 0.0, "mean" : 0.0 "percentageComplete" : 0.5, "finished" : false, "duration" : 224.0, "_links" : { "self" : { "href" : "http://localhost:9393/jobs/executions/1/steps/1"You can get information about running apps known to the system, either globally or individually. The following topics provide more details:
To retrieve information about all instances of all apps, query the
/runtime/apps
endpoint by using
GET
.
The following topics provide more details:
To retrieve information about all instances of a particular app, query the
/runtime/apps/<appId>/instances
endpoint by using
GET
.
The following topics provide more details:
To retrieve information about a particular instance of a particular application, query the
/runtime/apps/<appId>/instances/<instanceId>
endpoint by using
GET
.
The following topics provide more details:
You can get the application logs of the stream for the entire stream or a specific application inside the stream. The following topics provide more details:
Use the HTTP
GET
method with the
/streams/logs/<streamName>
REST endpoint to retrieve all the applications' logs for the given stream name.
The following topics provide more details:
To retrieve the logs of a specific application from the stream, query the
/streams/logs/<streamName>/<appName>
endpoint using the
GET
HTTP method.
The following topics provide more details:
To retrieve the logs of the task execution, query the
/tasks/logs/<ExternalTaskExecutionId>
endpoint by using the HTTP
GET
method..
The following topics provide more details:
The Springdoc library is integrated with the server in an opt-in fashion. Once enabled, it provides OpenAPI3 documentation and a Swagger UI.
To enable, set the following properties in your
application.yml
prior to launching the server:
springdoc:
api-docs:
enabled: true
swagger-ui:
enabled: true
The properties can also be set on the command line:
-Dspringdoc.api-docs.enabled=true -Dspringdoc.swagger-ui.enabled=true
or as environment variables:
SPRINGDOC_APIDOCS_ENABLED=true
SPRINGDOC_SWAGGERUI_ENABLED=true
Once enabled, the OpenAPI3 docs and Swagger UI are available at the
/v3/api-docs
and
/swagger-ui/index.html
URIs, respectively (eg.
localhost:9393/v3/api-docs
).
Ask a question. We monitor
stackoverflow.com
for questions
tagged with
spring-cloud-dataflow
.
Report bugs with Spring Cloud Data Flow at github.com/spring-cloud/spring-cloud-dataflow/issues .
As described in API Guide chapter, Spring Cloud Data Flow’s functionality is completely exposed through REST endpoints. While you can use those endpoints directly, Spring Cloud Data Flow also provides a Java-based API, which makes using those REST endpoints even easier.
The central entry point is the
DataFlowTemplate
class in the
org.springframework.cloud.dataflow.rest.client
package.
This class implements the
DataFlowOperations
interface and delegates to the following sub-templates that provide the specific functionality for each feature-set:
When you use the Data Flow Template, the only needed Data Flow dependency is the Spring Cloud Data Flow Rest Client, as shown in the following Maven snippet:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-rest-client</artifactId>
<version>2.11.0</version>
</dependency>
With that dependency, you get the
DataFlowTemplate
class as well as all the dependencies needed to make calls to a Spring Cloud Data Flow server.
When instantiating the
DataFlowTemplate
, you also pass in a
RestTemplate
.
Note that the needed
RestTemplate
requires some additional configuration to be valid in the context of the
DataFlowTemplate
.
When declaring a
RestTemplate
as a bean, the following configuration suffices:
@Bean
public static RestTemplate restTemplate() {
RestTemplate restTemplate = new RestTemplate();
restTemplate.setErrorHandler(new VndErrorResponseErrorHandler(restTemplate.getMessageConverters()));
for(HttpMessageConverter<?> converter : restTemplate.getMessageConverters()) {
if (converter instanceof MappingJackson2HttpMessageConverter) {
final MappingJackson2HttpMessageConverter jacksonConverter =
(MappingJackson2HttpMessageConverter) converter;
jacksonConverter.getObjectMapper()
.registerModule(new Jackson2HalModule())
.addMixIn(JobExecution.class, JobExecutionJacksonMixIn.class)
.addMixIn(JobParameters.class, JobParametersJacksonMixIn.class)
.addMixIn(JobParameter.class, JobParameterJacksonMixIn.class)
.addMixIn(JobInstance.class, JobInstanceJacksonMixIn.class)
.addMixIn(ExitStatus.class, ExitStatusJacksonMixIn.class)
.addMixIn(StepExecution.class, StepExecutionJacksonMixIn.class)
.addMixIn(ExecutionContext.class, ExecutionContextJacksonMixIn.class)
.addMixIn(StepExecutionHistory.class, StepExecutionHistoryJacksonMixIn.class);
return restTemplate;
PagedResources<AppRegistrationResource> apps = dataFlowTemplate.appRegistryOperations().list();
System.out.println(String.format("Retrieved %s application(s)",
apps.getContent().size()));
for (AppRegistrationResource app : apps.getContent()) {
System.out.println(String.format("App Name: %s, App Type: %s, App URI: %s",
app.getName(),
app.getType(),
app.getUri()));
A.2. Data Flow Template and Security
When using the DataFlowTemplate
, you can also provide all the security-related
options as if you were using the Data Flow Shell. In fact, the Data Flow Shell
uses the DataFlowTemplate
for all its operations.
To let you get started, we provide a HttpClientConfigurer
that uses the builder
pattern to set the various security-related options:
.create(targetUri) (1)
.basicAuthCredentials(username, password) (2)
.skipTlsCertificateVerification() (3)
.withProxyCredentials(proxyUri, proxyUsername, proxyPassword) (4)
.addInterceptor(interceptor) (5)
.buildClientHttpRequestFactory() (6)
Add a custom interceptor e.g. to set the OAuth2 Authorization header. This allows
you to pass an OAuth2 Access Token instead of username/password credentials.
Builds the ClientHttpRequestFactory
that can be set on the RestTemplate
.
Once the HttpClientConfigurer
is configured, you can use its buildClientHttpRequestFactory
to build the ClientHttpRequestFactory
and then set the corresponding
property on the RestTemplate
. You can then instantiate the actual DataFlowTemplate
using that RestTemplate
.
To configure Basic Authentication, the following setup is required:
RestTemplate restTemplate = DataFlowTemplate.getDefaultDataflowRestTemplate();
HttpClientConfigurer httpClientConfigurer = HttpClientConfigurer.create("http://localhost:9393");
httpClientConfigurer.basicAuthCredentials("my_username", "my_password");
restTemplate.setRequestFactory(httpClientConfigurer.buildClientHttpRequestFactory());
DataFlowTemplate dataFlowTemplate = new DataFlowTemplate("http://localhost:9393", restTemplate);
This section provides answers to some common ‘how do I do that…’ questions that often arise when people use Spring Cloud Data Flow.
If you have a specific problem that we do not cover here, you might want to check out stackoverflow.com to see if someone has already provided an answer.
That is also a great place to ask new questions (use the spring-cloud-dataflow
tag).
We are also more than happy to extend this section. If you want to add a “how-to”, you can send us a pull request.
B.1. Configure Maven Properties
You can set the Maven properties, such as the local Maven repository location, remote Maven repositories, authentication credentials, and proxy server properties through command-line properties when you start the Data Flow server.
Alternatively, you can set the properties by setting the SPRING_APPLICATION_JSON
environment property for the Data Flow server.
The remote Maven repositories need to be configured explicitly if the applications are resolved by using the Maven repository, except for a local
Data Flow server.
The other Data Flow server implementations (which use Maven resources for application artifacts resolution) have no default value for remote repositories.
The local
server has repo.spring.io/libs-snapshot
as the default remote repository.
To pass the properties as command-line options, run the server with a command similar to the following:
$ java -jar <dataflow-server>.jar --maven.localRepository=mylocal
--maven.remote-repositories.repo1.url=https://repo1
--maven.remote-repositories.repo1.auth.username=repo1user
--maven.remote-repositories.repo1.auth.password=repo1pass
--maven.remote-repositories.repo2.url=https://repo2 --maven.proxy.host=proxyhost
--maven.proxy.port=9018 --maven.proxy.auth.username=proxyuser
--maven.proxy.auth.password=proxypass
export SPRING_APPLICATION_JSON='{ "maven": { "local-repository": "local","remote-repositories": { "repo1": { "url": "https://repo1", "auth": { "username": "repo1user", "password": "repo1pass" } },
"repo2": { "url": "https://repo2" } }, "proxy": { "host": "proxyhost", "port": 9018, "auth": { "username": "proxyuser", "password": "proxypass" } } } }'
DEPS_FOLDER
should be a full filename or path expression for files to copy to the container.
CONTAINER_REPO
the source docker image name.
CONTAINER_TAG
the tag of source image.
PRIVATE_REGISTRY
the host name of the private registry.
export CONTAINER_REPO="springcloud/spring-cloud-dataflow-server"
export CONTAINER_TAG="2.9.5-jdk17"
export PRIVATE_REGISTRY="our.private.registry"
export DEPS_FOLDER="./extra-libs/"
docker build -f Dockerfile -t "$PRIVATE_REGISTRY/$CONTAINER_REPO:$CONTAINER_TAG"
docker push "$PRIVATE_REGISTRY/$CONTAINER_REPO:$CONTAINER_TAG"
B.3.2. JAR File
When using CloudFoundry or local deployment you will need to update jar before publishing it to a private registry or Maven Local.
Example
This example adds the dependencies and then installs the jar to Maven local.
./gradlew -i publishToMavenLocal \
-P appFolder="." \
-P appGroup="org.springframework.cloud" \
-P appName="spring-cloud-dataflow-server" \
-P appVersion="2.9.5" \
-P depFolder="./extra-libs"
B.4. Create containers for architectures not supported yet.
In the case of macOS on M1 the performance of amd64/x86_64 is unacceptable.
We provide a set of scripts that can be used to download specific versions of published artifacts.
We also provide a script that will create a container using the downloaded artifact for the host platform.
In the various projects you will find then in src/local
or local
folders.
Download or create container for: spring-cloud-dataflow-server
,
spring-cloud-dataflow-composed-task-runner
,
spring-cloud-dataflow-single-step-batch-job
,
spring-cloud-dataflow-tasklauncher-sink-kafka
,
spring-cloud-dataflow-tasklauncher-sink-rabbit
Skipper
local/download-app.sh
local/create-container.sh
Download or create container for: spring-cloud-skipper-server
Stream Applications
local/download-apps.sh
local/create-containers.sh
local/pack-containers.sh
create-containers.sh
uses jib
pack-containers.sh
uses pack
src/local/download-apps.sh
Downloads all applications needed by create-containers.sh
from Maven repository.
If the timestamp of snapshots matches the download will be skipped.
Usage: download-apps.sh [version]
src/local/create-containers.sh
Creates all containers and pushes to local docker registry.
This script requires jib-cli
Usage: create-containers.sh [version] [jre-version]
local/download-app.sh
Downloads all applications needed by create-containers.sh
from Maven repository.
If the timestamp of snapshots matches the download will be skipped.
Usage: download-app.sh [version]
local/download-apps.sh
Downloads all applications needed by create-containers.sh
from Maven repository.
If the timestamp of snapshots matches the download will be skipped.
Usage: download-apps.sh [version] [broker] [filter]
B.5.1. Prerequisites
You will need to install kubectl and then kind or minikube for a local cluster.
All the examples assume you have cloned the spring-cloud-dataflow
repository and are executing the scripts from src/local/k8s
.
On macOS you may need to install realpath
from Macports or brew install realpath
Kubernetes Provider
How do I choose between minikube and kind? kind will generally provide quicker setup and teardown time than Minikube. There is little to choose in terms of performance between the 2 apart from being able to configure limits on CPUs and memory when deploying minikube. So in the case where you have memory constraints or need to enforce memory limitations Minikube will be a better option.
Kubectl
You will need to install kubectl in order to configure the Kubernetes cluster
Kind is Kubernetes in docker and ideal for local development.
B.5.3. Building and loading containers.
For local development you need control of the containers used in the local environment.
In order to ensure to manage the specific versions of data flow and skipper containers you can set SKIPPER_VERSION and DATAFLOW_VERSION environmental variable and then invoke ./pull-dataflow.sh
and ./pull-skipper.sh
or if you want to use a locally built application you can invoke ./build-skipper-image.sh
and ./build-dataflow.sh
B.5.4. Configure k8s environment
You can invoke one of the following scripts to choose the type of installation you are targeting:
use-kind.sh [<namespace>] [<database>] [<broker>]
use-mk-docker.sh [<namespace>] [<database>] [<broker>]
use-mk-kvm2.sh [<namespace>] [<database>] [<broker>]
use-mk.sh <driver> [<namespace>] [<database>] [<broker>] (1)
use-tmc.sh <cluster-name> [<namespace>] [<database>] [<broker>]
use-gke.sh <cluster-name> [<namespace>] [<database>] [<broker>]
For kind follow instruction to update src/local/k8s/yaml/metallb-configmap.yaml
and then apply using kubectl apply -f src/local/k8s/yaml/metallb-configmap.yaml
For minikube launch a new shell and execute minikube tunnel
build-scdf-pro-image.sh
Build a docker image from the local repo of Dataflow Pro. Set USE_PRO=true
in environment to use Dataflow Pro
build-skipper-image.sh
Build a docker image from the local repo of Skipper.
configure-k8s.sh
Configure the Kubernetes environment based on your configuration of K8S_DRIVER.
delete-scdf.sh
Delete all Kubernetes resources create by the deployment.
destroy-k8s.sh
Delete cluster, kind or minikube.
export-dataflow-ip.sh
Export the url of the data flow server to DATAFLOW_IP
export-http-url.sh
Export the url of an http source of a specific flow by name to HTTP_APP_URL
install-scdf.sh
Configure and deploy all the containers for Spring Cloud Dataflow
load-images.sh
Load all container images required by tests into kind or minikube to ensure you have control over what is used.
load-image.sh
Load a specific container image into local kind or minikube.
local-k8s-acceptance-tests.sh
Execute acceptance tests against cluster where DATAFLOW_IP
is pointing.
register-apps.sh
Register the Task and Stream apps used by the unit tests.
B.6. Frequently Asked Questions
In this section, we review the frequently asked questions for Spring Cloud Data Flow.
See the Frequently Asked Questions section of the microsite for more information.
This appendix contains information how specific providers can be set up to work
with Data Flow security.
At this writing, Azure is the only identity provider.
C.1. Azure
Azure AD (Active Directory) is a fully fledged identity provider that provide a wide range of features
around authentication and authorization. As with any other provider, it has its
own nuances, meaning care must be taken to set it up.
In this section, we go through how OAuth2 setup is done for AD and
Spring Cloud Data Flow.
C.1.1. Creating a new AD Environment
To get started, create a new Active Directory environment. Choose a
type as Azure Active Directory (not the b2c type) and then pick your organization name and
initial domain. The following image shows the settings:
C.1.2. Creating a New App Registration
App registration is where OAuth clients are created to get used by OAuth
applications. At minimum, you need to create two clients, one for the
Data Flow and Skipper servers and one for the Data Flow shell, as these two have
slightly different configurations. Server applications can be considered to be
trusted applications while shell is not trusted (because users can see its full
configuration).
NOTE:
We recommend using the same OAuth client for both the Data Flow and the Skipper servers. While
you can use different clients, it currently would not provide any value, as the
configurations needs to be the same.
The following image shows the settings for creating a a new app registration:
C.1.4. Creating a Privileged Client
For the OAuth client, which is about to use password grants, the same API permissions need
to be created for the OAuth client as were used for the server (described in the previous section).
Privileged client needs a client secret, which needs to be exposed to a client
configuration when used in a shell. If you do not want to expose that secret, use the
Creating a Public Client public client.
C.1.5. Creating a Public Client
A public client is basically a client without a client secret and with its type set to public.
The following image shows the configuration of a public client:
C.1.6. Configuration Examples
This section contains configuration examples for the Data Flow and Skipper servers and the shell.
To starting a Data Flow server:
ROLE_DESTROY: dataflow.destroy
ROLE_MODIFY: dataflow.modify
ROLE_SCHEDULE: dataflow.schedule
security:
oauth2:
client:
registration:
dataflow-server:
provider: azure
redirect-uri: '{baseUrl}/login/oauth2/code/{registrationId}'
client-id: <client id>
client-secret: <client secret>
scope:
- openid
- profile
- email
- offline_access
- api://dataflow-server/dataflow.view
- api://dataflow-server/dataflow.deploy
- api://dataflow-server/dataflow.destroy
- api://dataflow-server/dataflow.manage
- api://dataflow-server/dataflow.modify
- api://dataflow-server/dataflow.schedule
- api://dataflow-server/dataflow.create
provider:
azure:
issuer-uri: https://login.microsoftonline.com/799dcfde-b9e3-4dfc-ac25-659b326e0bcd/v2.0
user-name-attribute: name
resourceserver:
jwk-set-uri: https://login.microsoftonline.com/799dcfde-b9e3-4dfc-ac25-659b326e0bcd/discovery/v2.0/keys
ROLE_DESTROY: dataflow.destroy
ROLE_MODIFY: dataflow.modify
ROLE_SCHEDULE: dataflow.schedule
security:
oauth2:
client:
registration:
skipper-server:
provider: azure
redirect-uri: '{baseUrl}/login/oauth2/code/{registrationId}'
client-id: <client id>
client-secret: <client secret>
scope:
- openid
- profile
- email
- offline_access
- api://dataflow-server/dataflow.view
- api://dataflow-server/dataflow.deploy
- api://dataflow-server/dataflow.destroy
- api://dataflow-server/dataflow.manage
- api://dataflow-server/dataflow.modify
- api://dataflow-server/dataflow.schedule
- api://dataflow-server/dataflow.create
provider:
azure:
issuer-uri: https://login.microsoftonline.com/799dcfde-b9e3-4dfc-ac25-659b326e0bcd/v2.0
user-name-attribute: name
resourceserver:
jwk-set-uri: https://login.microsoftonline.com/799dcfde-b9e3-4dfc-ac25-659b326e0bcd/discovery/v2.0/keys
$ java -jar spring-cloud-dataflow-shell.jar \
--spring.config.additional-location=dataflow-azure-shell.yml \
--dataflow.username=<USERNAME> \
--dataflow.password=<PASSWORD>
security:
oauth2:
client:
registration:
dataflow-shell:
provider: azure
client-id: <client id>
client-secret: <client secret>
authorization-grant-type: password
scope:
- offline_access
- api://dataflow-server/dataflow.create
- api://dataflow-server/dataflow.deploy
- api://dataflow-server/dataflow.destroy
- api://dataflow-server/dataflow.manage
- api://dataflow-server/dataflow.modify
- api://dataflow-server/dataflow.schedule
- api://dataflow-server/dataflow.view
provider:
azure:
issuer-uri: https://login.microsoftonline.com/799dcfde-b9e3-4dfc-ac25-659b326e0bcd/v2.0
$ java -jar spring-cloud-dataflow-shell.jar \
--spring.config.additional-location=dataflow-azure-shell-public.yml \
--dataflow.username=<USERNAME> \
--dataflow.password=<PASSWORD>
spring:
security:
oauth2:
client:
registration:
dataflow-shell:
provider: azure
client-id: <client id>
authorization-grant-type: password
client-authentication-method: post
scope:
- offline_access
- api://dataflow-server/dataflow.create
- api://dataflow-server/dataflow.deploy
- api://dataflow-server/dataflow.destroy
- api://dataflow-server/dataflow.manage
- api://dataflow-server/dataflow.modify
- api://dataflow-server/dataflow.schedule
- api://dataflow-server/dataflow.view
provider:
azure:
issuer-uri: https://login.microsoftonline.com/799dcfde-b9e3-4dfc-ac25-659b326e0bcd/v2.0
1
. SSL is disabled in this example, adjust accordingly for your environment and requirements
2
. SSL is disabled in this example, adjust accordingly for your environment and requirements