I have created a transactional que in MSMQ. Then I successfully submit two messages to that queue. The first message will cause an error in the processor and the MSMQ transaction will roll back; hence the message will get put back in the queue. The second message will succeed when processed and MSMQ transaction will commit.
Note: I do not have code to move the first message to another/poison queue yet which means it will keep getting picked up for processing and theoretically message 2 will never get a chance to be processed.
Problem: If I have 1 listener/processor processing message from that transactional queue, message 2 will never get picked up. This is expected.
However, If I have two listeners, message # 2 does get picked up; which confuses me. I thought MSMQ transaction queue will only let messages be processed in the order they arrived.
On a Side Note: How do I decide that the message 1 cannot be processed further and move it to the another queue. Does MSMQ keeps count of how many times a message was picked up by the processor?