I haven't had a chance to code a test yet, but had a few questions about how MQ reacts when multiple consumers are reading from a queue and commit/rollback is being used. For example, say I have a single instance of Q1 and there are two consumers reading from the queue, C1 and C2. Normally, each gets a message from the queue in turn until the queue runs out.
Now, suppose I introduce transactions in this scenario where each consumer behaves as follows:
- Get a message with
MQGMO_SYNCPOINT
set.
- Do some work that might take a few seconds (e.g., updating a DB table, invoking REST API, etc).
- Execute either commit (CMIT) or rollback (BACK) for the message.
There are various timing sequences with how C1 & C2 would interact with the queue. My questions are:
- While C1 is waiting to CMIT/BACK a message, is C2 blocked from reading a message, or does it get the next message in line? Assume the messages are independent and self-contained -- no need to process in sequence.
- If C1 chooses to rollback a message is it immediately available for C2 or C1 to get again?
- Are there special options I should consider when defining the queue that influence the behavior of CMIT and BACK?
As always thanks for your responses.
Jim
------------------------------
Jim Creasman
------------------------------