Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Daemon in Java: simple schedule application?

This app must perform connection to a web service, grab data, save it in the database. Every hour 24/7. What's the most effective way to create such an app in java?

How should it be run - as a system application or as a web application?

like image 730
EugeneP Avatar asked May 18 '26 09:05

EugeneP


1 Answers

Keep it simple: use cron (or task scheduler)

If that's all what you want to do, namely to probe some web service once an hour, do it as a console app and run it with cron.

An app that starts and stops every hour

  • cannot leak resources
  • cannot hang (may be you lose one cycle)
  • consumes 0 resources 99% of the time
like image 150
flybywire Avatar answered May 19 '26 21:05

flybywire