I have an application that uses JMS. Items are put on a queue and read from the queue in the same application. Now I need to introduce a sort of controlled rate when reading msgs from the queue.
Basically I need either:
a) ensure that there is a given time between dequeueing an item and dequeueing the next one
b) ensure that speed of dequeueing does not exceed a given rate (for instance one message per second)
Can anyone suggest how to achieve this? I have some ideas but they don't sound very good even to myself!