Scheduling Task in Spring/Java

前端 未结 5 1577
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-05 13:07

I am spawning a thread which will keep pulling the chunk of records from database and putting them into the queue. This thread will be started on the server load. I want thi

5条回答
  •  自闭症患者
    2021-01-05 13:51

    I think your requirement is just regular senario which quartz or spring scheduling framework supports very well. but you want to create a spececial approach to impl it. my suggestion is to keep it simple and stupid. spring scheudling will take advantage your worker thread by pooling instead of runing it all the time.

    As of statistics, it 's easy to check worker class's log. if you want see the statistics in web console, you need to record worker's log in database. I am sure you could make it easily in normal way.

提交回复
热议问题