I am developing a notification engine, this notification engine will send several types of notifications to several receivers.
- Email Notification
- Push Notification
- ...
When a certain client communicates with the notification engine in order to send a notification, the engine must store this notification in a certain queue, before communicating with the receiver.
I have a requirement that the flow should be as the below:
- Then notification engine must check if the receiver is able to send notifications now.
- If the receiver can send notifications, the message will be sent to it
- If the receiver cannot send notifications, the message must stay in the queue, and then try to be processed later.
For example, if I am sending an email notification, the Email receiver is running but the SMTP server is not accessible, so the receiver will not be able to send the email notification. The notification should stay in the queue, and will be processed later.
I know that there are several queuing systems that I may use like MSMQ and RabbitMQ.
What are the best practices that I can use in order to develop my logic and fulfill the requirements?