kafka消息

半兽人 发表于: 2015-03-10   最后更新时间: 2022-03-08 23:43:26  
{{totalSubscript}} 订阅, 11,696 游览

Messages consist of a variable-length header, a variable-length opaque key byte array and a variable-length opaque value byte array. The format of the header is described in the following section. Leaving the key and value opaque is the right decision: there is a great deal of progress being made on serialization libraries right now, and any particular choice is unlikely to be right for all uses. Needless to say a particular application using Kafka would likely mandate a particular serialization type as part of its usage. The RecordBatch interface is simply an iterator over messages with specialized methods for bulk reading and writing to an NIO Channel.

消息由一个可变长度header,可变长度不透明的key字节数据和不透明的可变长度value字节数组组成。header的格式在下一章节描述。保持不透明的key和value是正确决定:目前在序列化库方面取得了很大进展,任何特定的选择都不会适合所有的场景。不用说使用Kafka的特定应用程序可能需要特定的序列化类型作为其使用的一部分。RecordBatch接口是对用于批量读取和写入NIOChannel通道的专门方法的消息的简化迭代器。

更新于 2022-03-08
在线,4小时前登录

宇过天晴 7年前

TheMessageSetinterface is simply an iterator over messages with specialized methods for bulk reading and writing to an NIOChannel.
MessageSet接口是简单迭代器,通过特定以块为单元读写NIO 通道的方法遍历消息

宇过天晴 7年前

Messages consist of a fixed-size header and variable length opaque byte array payload. 
消息包含固定长度的消息头和不透明的可变长度字节数组

半兽人 -> 宇过天晴 7年前

感谢,已优化!

查看kafka更多相关的文章或提一个关于kafka的问题,也可以与我们一起分享文章