Forum Post: Possible to consume all messages off of a sonicmq queue in one go?

  • Thread starter paul.radbone@wins.co.uk
  • Start date
Status
Not open for further replies.
P

paul.radbone@wins.co.uk

Guest
Hi, Is it possible to consume all messages on a queue in one go? I'm currently doing the following: RUN createMessageConsumer IN hPTPSession (THIS-PROCEDURE, /* this procedure will handle it */ "pp_process_message", /* name of internal procedure */ OUTPUT hConsumer). IF ERROR-STATUS:ERROR THEN DO: MESSAGE ERROR-STATUS:GET-MESSAGE(1). END. RUN receiveFromQueue IN hPTPSession ("to_rest", /* name of queue */ ?, /* no message selector */ hConsumer). /* handles incoming messages*/ IF ERROR-STATUS:ERROR THEN DO: MESSAGE ERROR-STATUS:GET-MESSAGE(1). END. /* Start receiving messages */ RUN startReceiveMessages IN hPTPSession. IF ERROR-STATUS:ERROR THEN DO: MESSAGE ERROR-STATUS:GET-MESSAGE(1). END. with a wait for 0 to check if there are any messages. RUN waitForMessages IN hPTPSession ("inWait", THIS-PROCEDURE, 0). Now every time pp_process_message fires, I only get one message. Is there a way to do this, so that I can consume all messages available in one go?

Continue reading...
 
Status
Not open for further replies.
Top