5 Replies Latest reply on Nov 19, 2013 5:24 AM by aqtwrdnr aqtwrdnr

    EJB solution for doing something small 10 times per second

    aqtwrdnr aqtwrdnr Newbie



      I want to post 10 messages per second from a Stateless EJB to a JMS queue. Currently I have an asynchronous method with a while loop that posts a message to the queue and sleeps 100 millisecond, then posts another message to the queue and sleeps 100 milliseconds, etc.


      I am wondering if it is better to use the timerservice (with a timeout of 100 milliseconds) for this purpose. And more specifically; is the timer service suited for this kind of usage? The timing does not have to be accurate on the millisecond.


      Thanks in advance!