Implementing notification in webapp
We are developing and web application which allows users to register for certain events. What application is supposed to do, is to send them few notifications to remind them that they have registered. There will be more than 1k user which can register for many events in very wide time range. We have to send notofications like 3 months, 1 month, 1 week and one day before event.
 
The first thing is that I have to determine if I need to send notification to a specific user.  
I'm thinking about thread which will iterate over registrations and determine whether sending notification is required or not. If notification is required, should I do it right away or maybe put all of the objects that need it in some kind of cache and then send them (by another thread)?

Second thing is: if I made that thread - is better to put it and run next to application _or_ embed that thread into application and, for example, start it in the context listener? 

How You would solve this? Maybe there are better approaches?
Implementing notification in webapp
===

We are developing and web application which allows users to register for certain events. What application is supposed to do, is to send them few notifications to remind them that they have registered. There will be more than 1k user which can register for many events in very wide time range. We have to send notofications like 3 months, 1 month, 1 week and one day before event.
 
The first thing is that I have to determine if I need to send notification to a specific user.  
I'm thinking about thread which will iterate over registrations and determine whether sending notification is required or not. If notification is required, should I do it right away or maybe put all of the objects that need it in some kind of cache and then send them (by another thread)?

Second thing is: if I made that thread - is better to put it and run next to application _or_ embed that thread into application and, for example, start it in the context listener? 

How You would solve this? Maybe there are better approaches?