2 Replies Latest reply on Nov 10, 2010 2:14 PM by saegeun

    How can my queue have multiple unacknowledged/uncommitted messages?

    saegeun

      We're using HornetQ standalone (no MDB's) and we want to process multiple message in parallel. The reason is because each message can take around 20 secs to consume and process. So, one way to do this is have multiple threads all calling receive() on the queue (we're not doing this, but basically, it's still the same situation). We only want to acknowledge (or commit) a message and remove it from the queue when it's done being processed, so we don't lose the message in the event of a power failure.

       

      The problem is that it seems like HornetQ will not send the next message unless the current one is acknowledged (or committed if you're using transacted sessions). Is there a way to have hornetq keep sending messages even if there are unacked or uncommitted messages on the queue?

       

      Thanks, this is a pretty important issue for us, so any ideas would be a great help.

       

       

      ps - using CLIENT_ACKNOWLEDGEMENT could be a solution, but it may be really convoluted. This will let us receive multiple unacked messages, but since you have to ack all the messages you receive as a group (you can't selectively ack messages), it may not work for our situation. Because, we need to be able to ack all the messages that we've processed successfully and leave the ones we couldn't process unacked. I don't know, maybe with some tricky logic, you could get CLIENT_ACKNOWLEDGEMENT to do this, but it seems like this would be very convoluted. Thanks.