Search code examples
javadelaysendmessagetibcokdb

Pull times from a database and send out messages at that particular time


I have a q/kdb database where one of the columns has times. I want to take the data in each row, and send it out with tibco rendezvous at the time specified in the time column of each row. What would be the best way to do this?

It seems possible using the java timer and delay classes, or maybe with some third party stuff. Note: the complex part here is that I'm not sending out at a regular interval, i need to go to database to determine the time at which each message is sent.

So for example if the first two values in the column are 14:00:00.000 14:30:00.000 then the first message will be sent out at 2pm and the second will be sent out at 2:30pm.

Thanks!


Solution

  • Take look at ScheduledExecutorService, it has a schedule(Runnable command, long delay, TimeUnit unit) method that might do what you want