I have a Java EE 5 MDB-driven JMS system running on WebLogic 10.3.5, for delivering announcements via Email/IM/SMS. I have a requirement to specify a Date/Time window that announcements should be delivered within.
As far as I can make out there is no option to deliver/execute a JMS message at a certain Date/Time.
My list of announcements is in a DB table, so at present I have an EJB 3.0 Timer Bean that polls the table every 2 minutes and sends messages to a JMS queue for new announcements in that window.
It works, but I don't like that the DB table polling is the one key point in the system that won't scale in line with demand as does the JMS portion. I have partitioning on the table's status column, but even then doing a BETWEEN on two dates won't scale well as data grows.
Can people suggest a scalable solution that would allow me to forgo the table polling and just create JMS messages on Announcement creation that will defer their execution to a specified Date/Time? Critically the deferred execution should be persistent, surviving server restarts and automatically continuing to "wait" for execution on server restart.