aio-libs / aio-libs/aiokafka

Pass more information to the serializers/deserializers

未关闭
#891 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Python
星标
1.4k
派生
269
平均合并
1 天 1 小时
30 天内合并 PR
6

描述

**Describe the solution you'd like**

Serializers and deserializers should receive more context about the record they are working on :
* the headers
* the topic

It is especially useful when consuming from multiple topics at the same time, or topic with polymorphic messages advertised in the headers.

All information should be available (example here https://github.com/aio-libs/aiokafka/blob/master/aiokafka/consumer/fetcher.py#L286 and here https://github.com/aio-libs/aiokafka/blob/master/aiokafka/producer/producer.py#L352 ) but achieving backward compatibility could be tricky ? When they added headers to the java interface, they used a "default" method to ensure old implementations will still continue to work

**Additional context**

Java clients specs :
https://kafka.apache.org/28/javadoc/org/apache/kafka/common/serialization/Serializer.html
https://kafka.apache.org/28/javadoc/org/apache/kafka/common/serialization/Deserializer.html

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。