本月看点速览

  • 产品动态

    • 新增 PIP

    • 新增功能(2.5.2)

    • Bug 修复(2.5.2)

  • 社区动态

    • 海内外社区动态

    • 技术干货


产品动态

4 月 23 日,Apache Pulsar 2.5.1 版本正式发布。该版本合并了社区的 131 个 PR,修复了大量漏洞,涵盖 Broker、客户端、Pulsar Functions、connectors 等,进一步丰富和完善了 Pulsar 作为一个云原生流数据平台的能力。

更多详情可参考:Apache Pulsar 发布 2.5.1 版本

同时在 4 月初,Pulsar Go client 0.1.0 版本也正式发布了。全新的 pulsar-client-go 是一个使用 Go 语言编写的 Go Client 库,旨在替换原来的 CGO client,从而更好地支持 Pulsar在 Go 社区的应用和集成 。

更多技术细节可参考:Go Client 0.1.0 版本正式发布

新增 PIP

PIP 58: 支持消费者自定义消费重试延迟(2.6.0)

各种在线业务系统在进行消息处理时,可能会遇到多种异常情况。用户需要对这些产生异常的消息进行重试消费,且希望可以被灵活控制重试的延迟。

目前,对于异常消息常见的处理方式是将异常消息投递到一个特定的 topic 中,并且指定一个消息延迟时间。以使用户可以用相同的业务处理逻辑,同时订阅业务 topic 和重试 topic 以实现延时重试。

这个 PIP 提出了一个在 Pulsar 中直接支持这种常见需求的解决方案,增加了一系列”稍后重试消费”的接口和实现。这样,Pulsar 的用户可以使用原生的自定义时间重试消费的逻辑,简化了消息异常处理的流程。

邮件讨论:
https://lists.apache.org/thread.html/r5ab7533b6461f29b8ff18e4c51e058226a1b3081fddc5649b234b7fc%40%3Cdev.pulsar.apache.org%3E

PIP 链接:
https://github.com/apache/pulsar/wiki/PIP-58-%3A-Support-Consumers--Set-Custom-Retry-Delay

PIP 60: 支持使用 SNI 路由的代理服务器

代理服务器常被用于在多个客户端和服务器之间进行请求转发,为系统带来安全、负载均衡、自动扩展等收益。Pulsar 已经在 PIP-1 中提供了一个 proxy 的实现,在 broker 前作为网关提供逆向代理的功能。


但 Pulsar 目前并不支持包括 Apache traffic server (ATS)、 HAProxy、 Nginx、 Envoy 等一些通用代理。这些代理通常都具有 SNI路由功能,可以在TCP 层实现对 TLS 连接的转发。

这个 PIP 提出了一种对 Pulsar Client 进行增强的方案,修改路由查找和连接 broker 的流程,以支持客户端通过使用 SNI 路由的代理服务器连接 Pulsar 集群。


这样,Pulsar 用户可以使用客户端通过这些通用的代理服务器连接到 Pulsar 集群,从而利用这些代理服务器提供的安全性和可扩展性。

PIP 链接:
https://github.com/apache/pulsar/wiki/PIP-60%3A-Support-Proxy-server-with-SNI-routing

PIP 61: 支持多个 advertised address

Advertised address 是配置在 Pulsar broker 端,用于暴露给 client 进行服务发现的地址。目前 broker 只支持配置一个 advertised address。

但当部署在生产环境时,broker 通常同时连接到私有网络和公共网络,需要针对来自不同网络的客户端广播特定的 broker 的地址。

这个 PIP 提出了一种在 Pulsar broker 中增加一组新的配置,以支持为每个 broker 配置多个 advertised address 的方法,让客户端可以获取到对应网络内的 broker 的地址用于连接到 broker。

这个功能可以对需要通过多个地址访问 Pulsar broker 的场景提供支持,实现更好的服务质量和更低的成本:

  • 当 Pulsar 集群同时连接公共网络和私有网络时。

  • 当 Pulsar 集群和客户端部署在不同的 K8s 集群时。

  • 当使用支持事务的流处理时。

PIP 链接:
https://github.com/apache/pulsar/wiki/PIP-61%3A-Advertised-multiple-addresses

PIP 62: 将 connector、adapter 和 Pulsar Presto 移动到独立的代码仓库(2.6.0)

目前,Pulsar 在主代码仓库中提供了大量内置的 connector 和 adapter,包括 Pulsar SQL 也实际是一个 Presto connector。

这些组件显著的增加了整个工程的构建时间和复杂性。另一方面,开发 Pulsar 的核心消息存储功能所需的技能和开发 connector、adapter 等的技能也略有不同。

因此,这个 PIP 提出将 connector、adapter 和 Pulsar Presto 移动到 pulsar-connectors、pulsar-adapters、pulsar-sql 等独立的代码仓库。带来的收益包括:

  • 减少主工程的构建时间

  • 提高核心组件、connector 和 adapter 的开发效率

  • 对于不同的组件提供更快的 review 流程

PIP 链接:
https://github.com/apache/pulsar/wiki/PIP-62%3A-Move-connectors%2C-adapters-and-Pulsar-Presto-to-separate-repositories

新增功能

  • 客户端支持从 InputStream 动态加载 TLS 的证书和密钥

    https://github.com/apache/pulsar/pull/6760

  • 增加 ThresholdShedder 策略进行负载均衡

    https://github.com/apache/pulsar/pull/6772

  • 当消费者的通道不可写的时候跳过消息调度以避免反压

    https://github.com/apache/pulsar/pull/6740

  • 避免当数据 offload 到 HDFS 时预取过多数据

    https://github.com/apache/pulsar/pull/6717

  • 支持在 JWT authentication provider 中验证 audience

    https://github.com/apache/pulsar/pull/6716

  • 在 AuthorizationProvider 接口中增加 isSuperUser 方法

    https://github.com/apache/pulsar/pull/6708

  • 改进 Topic 中 backlogSize 的统计

    https://github.com/apache/pulsar/pull/6700

  • 让 broker 在系统内没有消息流通时依然遵守数据保留策略

    https://github.com/apache/pulsar/pull/6676

  • 支持配置 ZooKeeper 缓存超时时间

    https://github.com/apache/pulsar/pull/6668

  • 增加 namespace 级别的 AutoSubscriptionCreation 配置

    https://github.com/apache/pulsar/pull/6637

  • 优化 Key_Shared 订阅模式下消息分发的性能

    https://github.com/apache/pulsar/pull/6647

  • 增加开关跳过在短暂 OOM 时关闭 broker 的功能

    https://github.com/apache/pulsar/pull/6634

Bug 修复

Broker

  • 在创建负载均衡 znode 时等待已存在的 znode 超时

    https://github.com/apache/pulsar/pull/6788

  • 允许非持久化游标变为活跃状态

    https://github.com/apache/pulsar/pull/6769

  • 修复 backlog 游标在没有消费者时的检查逻辑

    https://github.com/apache/pulsar/pull/6766

  • 修复检查加密消息的 Metadata 后对象没有回收的问题

    https://github.com/apache/pulsar/pull/6745

  • 修复当 Consumer 和 Reader 同时连接时导致的死锁

    https://github.com/apache/pulsar/pull/6728

  • 修复多次创建删除同一个 namespace 时导致的异常问题

    https://github.com/apache/pulsar/pull/6713

  • 增加 Joda time 逻辑类型转换

    https://github.com/apache/pulsar/pull/6704

  • 在 Avro 消息编码失败时重置游标

    https://github.com/apache/pulsar/pull/6695

  • 修复加载 Pem 格式的私钥的问题

    https://github.com/apache/pulsar/pull/6691

 Admin Toolkit

  • 修复在使用 admin 工具获取批量消息时只拿到第一条的问题https://github.com/apache/pulsar/pull/6715

Client

  • Pulsar client 支持 Python 3.8

    https://github.com/apache/pulsar/pull/6741

  • 在 Python 客户端中增加对 deliver_at 和 deliver_after 的支持

    https://github.com/apache/pulsar/pull/6737

  • 修复解析 Avro Schema 的异常

    https://github.com/apache/pulsar/pull/6662

Function

  • 确保在异常时关闭所有的消费者

    https://github.com/apache/pulsar/pull/6778

  • 升级 Go Function 使用的 Go Client 版本到 0.1.0

    https://github.com/apache/pulsar/pull/6753


社区动态

TGIP 直播又迎更新

4 月份,TGIP-CN 和 TGIP 直播继续更新中。中文文字+视频回顾可以直接点击下方链接进入,英文视频回顾可以参考后续链接。

 

TGIP-CN:

  • 008: 玩转 Dubbo-go & Pulsar

  • 009: Pulsar 读写过程的性能调优

  • 010: Kafka-on-Pulsar 的前世今生

TGIP:

  • 005: Take a deep-dive into Pulsar architecture for performance tuning
    https://www.youtube.com/watch?v=8O_RNYHX9tI

  • 006: Lifecycle of a Pulsar message
    https://www.youtube.com/watch?v=R197TYYFaiI

  • 007: Cluster & Geo-replication
    https://www.youtube.com/watch?v=0UoCHpdG9E0

  • 008: What's new in Pulsar 2.5.1 (5 月 2 日直播)
    https://www.youtube.com/watch?v=qb1WhZSeMzg 

多个联合分享全球化

4 月 28 日,由 Pulsar 专家 Devin Bost 带来「Common architectural patterns on Apache Pulsar」,为大家讲述 Overstock 是如何在生产中使用 Pulsar、如何将流式存储与 Apache Ignite 结合。

视频回放:
https://www.youtube.com/watch?v=pmaCG1SHAW8

Slides:
https://www.slideshare.net/DevinBost/realworld-pulsar-architectural-patterns

4 月 30 日,郭斯杰在开源社区 data #ossday 上分享「Event Streaming with Apache Pulsar」的相关内容。

注册申请链接:
https://web.cvent.com/event/001916f7-391a-4e9e-b0d8-0688882c85e3/summary?RefId=Web

Pulsar 官网使用细节

为了让大家更好更高效的使用 Pulsar 官网,我们撰写了一份简单的《Pulsar 官网使用指南》,方便大家进行查阅和了解 Pulsar 细节。

哇哦!原来 Pulsar 官网还可以这样用

✍️ 技术博客

  • Apache Pulsar 分层存储帮你省钱

  • 如何使用 Apache Flink 查询 Pulsar 流

  • Will Apache Pulsar eventually kill Apache Kafka?
    https://medium.com/@manrai.tarun/will-apache-pulsar-eventually-kill-apache-kafka-853be9c0ce13

  • Apache Pulsar Outperforms Apache Kafka by 2.5x on OpenMessaging Benchmark
    https://medium.com/@manrai.tarun/apache-pulsar-outperforms-apache-kafka-by-2-5x-on-openmessaging-benchmark-4838c14a541f

  • Taking a Deep-Dive into Apache Pulsar Architecture for Performance Tuning
    https://streamnative.io/whitepaper/taking-a-deep-dive-into-apache-pulsar-architecture-for-performance-tuning/

  • 4 Data Trends to Watch in 2020
    https://medium.com/memory-leak/4-data-trends-to-watch-in-2020-491707902c09

  • How to Build a Distributed Database with Apache BookKeeper — Part 2
    https://streamnative.io/blog/tech/2020-04-14-distributed-database-bk2/

  • Why we moved from Apache Kafka to Apache Pulsar 
    https://streamnative.io/blog/tech/2020-04-21-from-apache-kafka-to-apache-pulsar/


以上就是 4 月份的脉动之旅。提前祝大家劳动节假期快乐!娱乐的同时也要保护好身体哦!

Apache Pulsar 社区鼓励大家积极参与开源社区,无论是文档、代码、翻译,还是技术博客,都欢迎大家积极参与,早日成为 Pulsar contributor,一起加油鸭。

如果你对 Pulsar Contribute 的流程不太熟练,也可以参考我们这篇小教程,让你熟悉如何通过 GitHub 对 Pulsar 进行贡献:新手向|非技术人员如何参与 Pulsar 项目进行贡献。

参与贡献项目可选:

  • Apache Pulsar 项目:
    https://github.com/apache/pulsar

  • Pulsar 技术文档翻译:
    https://github.com/apache/pulsar-translation