I am evaluating Message Brokers for a project and could not find a clear answer to whether Apache Kafka supports the following use case:
- Messages with additional attributes to filter on at receiving the messages are pushed to topics. These additional attributes can be considered as a primary key for each message, in the simplest form it is just one Id-Attribute (e.g. an Id of a sensor that (unregularly) produces measurement data).
- 0 to n consumers receive these messages from the topics, eventually filtering on the primary key.
- Messages are not consumed at receiving them, so all consumers on the topics will receive all messages pushed to them as long as they are consuming them (being "online").
- When there is no consumer receiving messages from a topic the Message Broker at least updates the internal state of messages per primary key.
- When a consumer subscribes a topic, it has to be able to receive the last message written per primary key at start and from then on all new messages pushed to the queue, eventually filtered by the primary key. The receiver should be able to recognize somehow, that all messages of the initial state at start were received.
Does Kafka support this use case and how could this be achieved? If Kafka is not able to provide this functionality, what other Message Brokers might be able to do so?