I am trying to mimic a continuously running scheduler/batch process or a setInterval method that runs every 20 seconds and checks the DB for any outstanding records. If there are, it processes them and then waits for 20 seconds before starting over.
The above is the setup i have which achieves what i want. I just want to post it out there to see if there is a better way to do it . I am also not sure of the memory footprint for this setup. I also clear the payload in the msg object that i used for storing db records.
The above is not a working version. But an outline of what i want to achieve.
Any thoughts would be beneficial.