通过Spring Cloud流式传输

本文介绍了Spring Cloud Stream作为一个用于构建高度可扩展的事件驱动微服务的框架,其核心特性包括活页夹(binder)和功能范式。活页夹允许与消息系统集成,而功能范式使得通过spring-cloud-function处理消息变得简单。文章还提到了Spring Cloud Stream的简化测试功能,通过改进的测试粘合剂进行测试。文章详细讨论了活页夹的概念、功能范式的优点,以及如何通过基本配置和测试方法来利用Spring Cloud Stream的优势。
摘要由CSDN通过智能技术生成

Writing asynchronous messaging applications and eventually-consistent systems provides many advantages, including:

编写异步消息传递应用程序和最终一致的系统具有许多优点,包括:

  • Maximization of throughput — especially in cases where immediate consistency is not required

    吞吐量最大化—特别是在不需要立即一致性的情况下
  • Offloading of workflows to provide an immediate response to a user

    卸载工作流以向用户提供立即响应
  • Ability to scale various portions of the workflow differently as needed

    能够根据需要以不同方式扩展工作流的各个部分
  • Support of backpressure around system bottlenecks

    支持系统瓶颈周围的背压

Modern platforms and frameworks have made writing asynchronous messaging systems very easy. Recently, I have had some time to explore Spring Cloud Stream, and I have come to find that it has many advantages over other frameworks.

现代平台和框架使编写异步消息传递系统变得非常容易。 最近,我花了一些时间来探索Spring Cloud Stream,并且我发现它比其他框架有很多优势。

“Spring Cloud Stream is a framework for building highly scalable event-driven microservices connected with shared messaging systems.

“ Spring Cloud Stream是一个框架,用于构建与共享消息系统连接的高度可扩展的事件驱动型微服务。

“The framework provides a flexible programming model built on already established and familiar Spring idioms and best practices, including support for persistent pub/sub semantics, consumer groups, and stateful partitions.” (reference)

“该框架提供了一个灵活的编程模型,该模型基于已经建立并熟悉的Spring习惯用法和最佳实践,包括对持久性发布/订阅语义,使用者组和有状态分区的支持。” ( 参考 )

Recently, Spring Cloud Stream introduced several new features that have made it an easy option for processing asynchronous messaging streams. There are two in particular that I want to focus on.

最近,Spring Cloud Stream引入了一些新功能,这些功能使其成为处理异步消息流的简便选择。 我要特别关注两个。

  • Functional paradigm for message processing through spring-cloud-function

    通过spring-cloud-function处理消息的功能范式
  • Simplified testing with an improved test binder

    使用改进的测试粘合剂简化测试

背景 (Background)

Spring Cloud Stream evolved out of the Spring Integration project as it embraced Spring Boot and moved into the modern cloud era. Spring Cloud Stream relies on the concept of a binder to handle the integration with a messaging or event streaming framework. At the time of publication, there were binders for Apache Kafka, Kafka Streams, Rabbit MQ, Azure Event Hubs, Google Cloud PubSub, and many others (see the list).

Spring Cloud Stream包含Spring Boot,并脱离了Spring Integration项目,并进入了现代云时代。 Spring Cloud Stream依靠绑定器的概念来处理与消息传递或事件流框架的集成。 在发布之时,有用于Apache Kafka,Kafka Streams,Rabbit MQ,Azure Event Hubs,Google Cloud PubSub以及许多其他文件夹的活页夹( 请参阅清单 )。

The binders support the core features of modern messaging/eventing systems:

活页夹支持现代消息传递/事件系统的核心功能:

  • Publish/Subscribe (multiple consumers of the same data)

    发布/订阅(相同数据的多个使用者)
  • Consumer Groups (horizontal scaling of a single consumer)

    消费者组(单个消费者的水平扩展)
  • Partitioning

    分区
  • Message-driven consumers

    消息驱动的消费者
  • Polling-based consumers

    基于轮询的消费者

活页夹 (Binder)

A binder handles the integration with a single framework. This abstraction allows your code to be middleware-neutral, focusing only on core business logic. The application core only needs to interact with a canonical message.

活页夹通过单个框架处理集成。 这种抽象允许您的代码与中间件无关,仅关注核心业务逻辑。 应用程序核心仅需要与规范消息进行交互。

Binders can be used on both the input and output side to interact with producers or consumers of

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值