# Stream Pipeline DSL

Stream 是通过 unix启发的 [Pipeline语法](https://en.wikipedia.org/wiki/Pipeline_\(Unix\)) 定义的。语法使用 `|`，也称为“管道”来连接多个命令。Unix中的命令 `ls -l | grep key | less` 表示接收 `ls -l` 进程的输出，并将其通过管道传输到 `grep key` 进程的输入。 然后将输出`grep`发送到`less`过程的输入。每个`|`符号将左边命令的输出发送到右边命令的输入。数据从左到右通过管道。

在Data Flow中，Unix命令被[Spring Cloud Stream](https://cloud.spring.io/spring-cloud-stream/) application取代，每个 `|` 符号表示通过消息传递中间件（如RabbitMQ或Apache Kafka）连接应用程序的输入和输出。

每个Spring Cloud Stream application都以简单名称注册。注册过程指定可以获取应用程序的位置（例如，在Maven存储库或Docker注册表中）。您可以在 [本节中](https://docs.spring.io/spring-cloud-dataflow/docs/2.1.0.RELEASE/reference/htmlsingle/#spring-cloud-dataflow-register-stream-apps)[ ](https://docs.spring.io/spring-cloud-dataflow/docs/2.1.0.RELEASE/reference/htmlsingle/#spring-cloud-dataflow-register-stream-apps)找到有关如何注册 application 的更多信息。在Data Flow 中，我们将 Spring Cloud Stream application 分类为Sources，Processors或Sinks。

举一个简单的例子，考虑从HTTP获取数据写入文件。使用Stream DSL描述如下：

`http | file`

涉及某些数据处理的 Stream 将表示为：

`http | filter | transform | file`

可以使用shell的`stream create`命令创建流定义，如以下示例所示：

`dataflow:> stream create --name httpIngest --definition "http | file"`

&#x20;`--definition` 命令选项用来配置具体的 Stream DSL 传递过程

Stream definitions 的部署是通过shell的`stream deploy`命令完成的。

`dataflow:> stream deploy --name ticktock`

“ [入门”](https://docs.spring.io/spring-cloud-dataflow/docs/2.1.0.RELEASE/reference/htmlsingle/#getting-started)部分介绍了如何启动服务器以及如何启动和使用 Spring Cloud Data Flow shell。

请注意，shell 调用 Data Flow Servers 的 REST API。有关直接向服务器发出HTTP请求的更多信息，请参阅[REST API指南](https://docs.spring.io/spring-cloud-dataflow/docs/2.1.0.RELEASE/reference/htmlsingle/#api-guide)。
