Pulsar Messaging
Pulsar Java client · Apache Pulsar
Pulsar Java Client
Pulsar 主要通过**发布-订阅模式(pub-sub)**提供消息服务。
一旦创建订阅,即使 consumer 断开连接,Pulsar 仍然可以保存所有消息,直到被 consumer 确认消费成功后才删除消息。
其中消息(Message)是 Pulsar 的基础单元,一条 Message 包含以下要素:
Value(Data Payload):消息有效负荷;Key:消息标记键,如 topic 压缩操作是通过 Key 进行标识的;Properties:用户自定义属性;Producer name:消费者名称,如果未指定,使用 default;Sequcence ID:序列 ID,所有 Message 在其 Topic 中都是有序的,Sequence ID 由于确保有序性;Publish time:发布时间,该时间戳是自动附加的;Event time:可选的时间时间,默认 0;TypedMessageBuilder:消息构建器,如 String、AVRO 等;Pulsar binary protocol specification · Apache Pulsar
Pulasr Message 二进制协议