In our scenario we have a set of micro services which interact with other services by sending event messages. We anticipate millions of messages per day at the peak. Every message is targeted to one or more listener types. Our requirements are as follows:
- Zero lost messages.
- Ability to dynamically register multiple listeners of a specific type in order to increase throughput.
- Listeners are not guaranteed to be alive when messages are dispatched.
We consider 2 options:
- Send each message to JMS main queue then listeners of that queue will route the messages to specific queues according to message content, and then target services will listen to those specific queues.
- Send messages to a Kafka topic by message type then target services will subscribe to the relevant topic and consume the messages.
What are the cons and pros for using either JMS or Kafka for that purpose?