TIme-based Notification Architecture

六眼飞鱼酱① 提交于 2020-08-24 04:00:46

问题


I am designing a notification service (server). I can have two kinds of notifications: one which is delivered immediately, and the other is delivered at some time in the future.

Is there a framework to handle the future notifications?

I know I can write background worker who can for example sample the DB to look for a notification which needs to be sent, but I sure millions tried to solve this problem already and I'd prefer to reuse a proven solution.

I didn't decide yet on the framework / DB. I am thinking I should use either vertx.io or Jetty (WebSockets) for push notification. I am not sure regarding the DB because I wanted it to support those future notifications.

Update: How will you recommend I should save the data in DB for "live" notifications (notifications which exists in the users inbox) and for future notifications?

Update: I am thinking of using either:

  1. Jetty + Spring for WebSocket & SockJS + Quartz
  2. Vertx.io (Supports Websocket and Sockjs)

Any recommendation?


回答1:


One approach is to deliver the notifications to a Scheduling component. The scheduling component consumes all notifications, stores it and checks regularly to see if a notification is due to be sent out.

This will allow to attach a listener to the notifications and not pile up the notifications at publisher side.



来源:https://stackoverflow.com/questions/35230156/time-based-notification-architecture

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!