kafka过滤消息与墓碑
我正在阅读 Kafka 中的消息过滤,我看到了一些对我来说很有趣的示例,但我有一个问题,这不是我收到的代码错误,而只是为了确认我的理解。
如果我正确地阅读了代码,例如消息的过滤器只会使记录为空
是record null 不等于说内容是墓碑记录吗? 进一步的过程如何能够理解这是一个有效的墓碑记录还是一条被过滤的简单消息(我可以理解消息密钥会有所不同)
主要针对对墓碑感兴趣的系统我只是想知道是否进行过滤不会产生不良后果,但也许我对“空”与墓碑相同的理解是完全错误的。
我确实明白(或者我认为我明白) record.value() == null
或 record == null
之间存在差异,但这不会造成很多影响转换链的其余部分中有多少空指针异常?
感谢您的任何反馈。
I'm reading into the filtering of messages in Kafka and I've seen some examples that look interesting to me but I have a questions, which is not a code error I'm getting but is just to confirm my understanding.
If I read the code correctly for example the filter of the message just makes the record null
Is the record null not the same as saying the content is a tombstone record?
How will the further process be able to understand if this was a valid tombstone record or a simple message that was filtered (I can understand the message key will be different)
Mainly for systems that are interested in the tombstone I'm just wondering if filtering will not have un-desired consequences but maybe my understanding of the "null" being the same as tombstone is totally wrong.
I do understand (or I think I do) that there is a difference between record.value() == null
or record == null
but would this not cause a lot of null pointer exceptions in the rest of the transformation chain?
Thanks for any feedback.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
逻辑删除记录具有非空键和空值属性。您无法获取空 Connect Record 实例的键。
转换链将忽略后续转换中的空记录,因此它们比根据特定属性进行过滤更“被丢弃”
A tombstone record has a non-null key, and null value property. You cannot get a key of a null Connect Record instance.
The transformation chain will ignore null records on subsequent transforms, therefore they are more "dropped" than filtered based on a particular attribute