• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

emaill reminders

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello good people
I'm wondering what the best protocol is for sending email reminders to users who need to do something.
Do coders usually have the application run through the users and their status every day at a certain time --
so the application checks for a time?
Thanks
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Elicia,

this is dependent on the reason that leads to a user notification and the application, I think.

What triggers an email notification? Is it in direct response to a user interaction? Or do you just have to perform necessary checks in a regular interval? How often do you have to do this? Regular checks may depend on the type of your application, because you have to think about a scheduler implementation to trigger the checks. Is the application running permanently, so that it can take care of checks itself? Do you need external scheduler like cron in UNIX/Linux? Is it critical if you miss an interval because of a system downtime? etc. etc.

If you have answers to these questions it's time to think about more concrete solutions ;-)

Marco
 
elicia dent
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marco
Thanks.
The application will be running continuously. The requirement is to send an email weekly to each user who still needs to fill out a form (once they finish a flag in the db will be tripped to indicate they are done).
Perhaps a cron is the way to go.
No, its nothing critical related to system maintenance.
Elicia
 
Rancher
Posts: 377
Android Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I recently had to do something similar from within a web application. I recommend taking a look at java quartz which is a nice open source project for scheduling tasks.

Sean
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Elicia,

if the application is running permanently I'd prefer to NOT depend on external services like cron. It's not a big deal to configure jobs with it, but I've often seen that cron jobs have been forgotten to setup or nobody noticed that the job didn't work any longer because of some problems and so on.

If you're application is running inside a servlet container or a full application server, it's likely that you already have a access to some kind of timer or scheduler mechanism (at least with most J2EE/JEE containers). If it's a standalone application I would recommend the Quartz library. It's very powerful and can handle all kinds of scheduling timings. All you have to do yourself is create some kind of task to perform the necessary database checks and notify the corresponding user via email and the scheduler will take care of running the task in intervals or at specific time.

I hope that helps a little bit...

Marco
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I was a little bit too late, but at least we agree regarding Quartz
 
elicia dent
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Super, thats what I'll do, thanks a lot, and its nice to have two agreed opinions
Elicia
 
Sean Clark
Rancher
Posts: 377
Android Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you put more effort into your post though.

Does Tomcat have an internal scheduler? I couldn't find one and quartz has a nice servlet initialiser so you can start it within the web application and I liked that. All the other setting were in a properties and XML file so it was relatively simple.
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat uses Quartz internally. You can see it running additional scheduler threads with Quartz, although I don't know what for what exactly Tomcat uses it. Anyway, I'm pretty sure you can't use it directly from within your web app. Application servers like Glassfish or JBoss provide a timer service for applications, but I think this would be overkill as Quartz is a perfect solution as Sean pointed out.

Marco
 
Water! People swim in water! Even tiny ads swim in water:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!