根据事件标头(元数据)限制Kafka消费者

发布于 2025-01-22 19:18:14 字数 298 浏览 3 评论 0原文

这本书“建筑事件驱动的微服务” 为使用metatags(事件标头)提供了对Kafka消费者的限制。其中之一是:

弃用:

表明流过时的一种方法。将事件流标记为弃用 允许现有系统继续使用它 新的微服务被阻止请求订阅... 有剥夺事件的所有者可以在有事件的所有者中通知 不再有未弃用流的注册用户,此时 可以安全删除。

您能指出我,如何实现这一点(以Java/spring为中心)? Kafka ACL是否有可能根据事件标头进行限制?

先感谢您!

The book "Building Event-Driven Microservices" gives good practice to use a metatags (event headers) for placing restrictions on Kafka consumers. One of which is the following:

Deprecation:

A way to indicate that a stream is out of date. Marking an event stream as deprecated
allows existing systems to continue using it while
new microservices are blocked from requesting a subscription... the
owner of the deprived stream of events can be notified when there are
no more registered users of the deprecated stream, at which point it
can be safely deleted.

Can you point to me please, how this can be implemented (Java/Spring centric)? Is it possible for Kafka ACL to make restrictions based on event headers?

Thank you in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧时浪漫 2025-01-29 19:18:15

Kafka ACL是否有可能根据事件标题进行限制?

不,但是收到消息后可以过滤出来。 ACL将阻止整个分区访问,而不是特定记录。

当不再有弃用流的注册用户

的注册用户时,可以通知被剥夺的事件流的所有者

您需要记住,您需要记住Kafka不是纯消息解决方案,并且它没有一个概念“注册”消费者,只要群集没有删除该消息,就可以随时使用。

您需要实施自己的“通知”管道,即对原始主题没有感兴趣的实例(甚至可能再次与Kafka感兴趣)。

Is it possible for Kafka ACL to make restrictions based on event headers?

No, but you can filter out after receiving the message. ACLs will prevent access to partition as a whole, not to particular records.

the owner of the deprived stream of events can be notified when there are no more registered users of the deprecated stream

You need to remember that Kafka is not a pure messaging solution, and it does not have a concept of "registered" consumers, at any time as long as the message has not been removed by the cluster.

You'd need to implement your own "notification" pipeline that there are no instances interested in the original topic (possibly even with Kafka again).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文