0

I'm searching materials/ideas/designs to solve architecture problem: I'll have several agents which handle some processing, as a result they can generate state for clients which will expire after some time. Let's say client sent presence state which expire after 1h. I wondering how to write service to keep track of expiration time of scheduled events.

1) create sorted collection with timestamps and process it by some executor

2) put all into DB and perform cyclic check using sorted query

Any suggestions are appreciated.

The Tosters
  • 417
  • 3
  • 15

1 Answers1

1

If you are using spring framework, you can use Spring cron http://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/scheduling.html

paul
  • 12,873
  • 23
  • 91
  • 153