I'm nmew to AMQP and trying to work out a notification architecture for a RabbitMQ system.
I want a Topic exchange (NotificationsExchange, let's say), specifically because I want to flexibility with routing keys and queues that comes with the topic exchange as well as more options for future expansion on the topic. I might be wrong though, because...
I also want to have each notification consumed by two or more consumers. As a baseline, I want each notification published to wind up in a database. Additionally, I want each notification to be eligible for consumption by a client application (e.g., web app to consume and further push through sockets for immediate user notification without db polling).
This really sounds like a fanout exhange situation, except I didn't want to do that because I'd need a whole lot more queues to handle the various notifications (I think - still new to AMQP and trying to wrap my head around it).
Is it possible to have two consumers get notified (consistently) from the same queue?
For example:
- Push
Notif.NotifGroup.User.ThisUserthrough the NotificationExchange - Have
dbListenerbind toNotif.# - Have
mvcClientListeneralso bind toNotif.#(and further determine if the user is online and push downstream via socket)
I'm not sure if I'm on the right track here. I'm reading that "multiple consumers to the same queue are load balanced in a round robin fashion", and quite frankly, I don't know what that means.
Is it possible to have a Topic Exchange where two consumers can consistently read the same messages from the same queue (e.g., same routing key), or must I go with a Fanout Exchange for this?
Thanks.