简体   繁体   English

Spring集成或Spring Cloud数据流

[英]Spring Integration or Spring Cloud Data Flow

I'm in the process of moving some of my application to microservices. 我正在将我的一些应用程序移动到微服务。 One example service is a RSS crawler which uses Spring Integration to send items to Kafka. 一个示例服务是RSS爬虫,它使用Spring Integration将项目发送到Kafka。 I also see there is Spring Cloud Data Flow which uses Spring Integration and Spring Batch under the hood. 我还看到Spring Cloud Data Flow使用了Spring Integration和Spring Batch。

If I used Spring Cloud Data Flow, would I use this within each microservice or is it used as orchestration between microservices? 如果我使用Spring Cloud Data Flow,我会在每个微服务中使用它还是用作微服务之间的编排?

I'm trying understand the benefits of introducing Spring Cloud Data Flow as opposed to keeping the microservices as light as possible using Spring Integration. 我正在尝试了解引入Spring Cloud数据流的好处,而不是使用Spring Integration保持微服务尽可能轻。

Any advice would be appreciated. 任何意见,将不胜感激。

The SI based "RSS crawler" service can be packaged as a Spring Cloud Stream application. 基于SI的“RSS爬虫”服务可以打包为Spring Cloud Stream应用程序。 Once you have done that, your "RSS crawler" turns into a standalone event-driven microservice that automatically can either talk to Kafka, Rabbit, or other brokers (depending on the binder implementation in the classpath). 完成后,您的“RSS爬虫”将变成一个独立的事件驱动的微服务,可以自动与Kafka,Rabbit或其他代理进行通信(取决于类路径中的binder实现)。 The same app is a portable workload that can run on any public or private cloud platforms. 同一个应用程序是可以在任何公共或私有云平台上运行的便携式工作负载。

Once you have an "n" number of such standalone applications, you'd need a higher-level orchestration layer to compose the applications into a coherent data pipeline. 一旦有了“n”个这样的独立应用程序,就需要一个更高级别的业务流程层来将应用程序组合成一个连贯的数据管道。 Spring Cloud Data Flow helps with it. Spring Cloud Data Flow有助于它。 You can build a pipeline like the following with SCDF's DSL. 您可以使用SCDF的DSL构建如下所示的管道。

stream create foo --definition "rss-crawler | filter | transform | cassandra" stream create foo --definition“rss-crawler | filter | transform | cas​​sandra”

Here, four applications come together to form a data pipeline. 这里,四个应用程序组合在一起形成数据管道。 Each one of them is a Spring Cloud Stream application that can be independently developed and tested in isolation. 它们中的每一个都是Spring Cloud Stream应用程序,可以独立开发和测试。 Finally, SCDF would deploy the applications onto target platforms like Cloud Foundry or Kubernetes as native applications. 最后,SCDF会将应用程序部署到Cloud Foundry或Kubernetes等目标平台上作为本机应用程序。

Hope this further clarifies. 希望这进一步澄清。

Right, you use Spring Integration within you Microservices and Data Flow to connect and orchestrate them. 是的,您可以在微服务和数据流中使用Spring Integration来连接和编排它们。 That is just a side effect that Spring Cloud Data Flow uses Spring Integration and Spring Batch for its internal logic. 这只是Spring Cloud Data Flow将Spring Integration和Spring Batch用于其内部逻辑的副作用。

In this picture you might just miss the fact of the Spring Cloud Stream level in between: https://cloud.spring.io/spring-cloud-stream/ 在这张图片中,您可能会错过Spring Cloud Stream级别之间的事实: https//cloud.spring.io/spring-cloud-stream/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM