We're trying to build a platform using microservices that communicate async over kafka. It would seem natural, the way i understood it, to have 1 topic per aggregate type in each microservice. So a microservice implementing user registration would publish user related events into the topic "users". Other microservices would listen to events created from the "users" microservices and implement their own logic and fill their DBs accordingly. The problem is that other microservices might not be interested in all the events generated by the user microservice but rather a subset of these events, like UserCreated only (without UsernameChanged... for example). Using RabbitMq is easy since event handlers are invoked based on message type.
- Did you ever implement message based routing/filtering over kafka?
- Should we consume all the messages, deserialize them and ignore unneeded ones by the consumer? (sounds like an overhead)
- Should we forward these topics to storm and redirect these messages to consumer targeted topics? (sounds like an overkill and un-scalable)
- Using partitions doesn't seem logical as a routing mechanism