0

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!

zashto
  • 5
  • 3

1 Answers1

0

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).

Adam Kotwasinski
  • 4,377
  • 3
  • 17
  • 40