Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSMQ competing consumer

Can someone tell me whether MSMQ (using transactions) supports competing consumers? Basically, I have multiple threads dequeueing messages off of a single queue. Just wanted to make sure this will work since MSMQ sometimes behaves differently than I expect.

like image 628
HH. Avatar asked Oct 09 '09 20:10

HH.


People also ask

What is the replacement for MSMQ?

Kafka, RabbitMQ, IBM MQ, Azure Service Bus, and ActiveMQ are the most popular alternatives and competitors to MSMQ.

Is MSMQ still supported?

As a Windows component, MSMQ is technically “supported” as long as it's carried by a supported version of Windows. Since it exists in Windows 10 and Windows Server 2019, MSMQ will continue to live on until at least 2029—and much longer assuming it isn't removed from future versions of Windows. The System.

What is MSMQ used for?

MSMQ is essentially a messaging protocol that allows applications running on separate servers/processes to communicate in a failsafe manner. A queue is a temporary storage location from which messages can be sent and received reliably, as and when conditions permit.


1 Answers

If you are calling Receive from multiple processes on the same machine on the same queue, you will not get the same message more than once -- unless you rollback a transaction from a read.

If you are using 2008/w7 and are receiving on multiple machines from the same remote queue within a transaction, you should not see the same message twice (again, unless you roll back).

If you are using an enumerator to peek the messages and then remove an interesting one (via RemoveCurrent), you should expect to see an exception that the message has already been removed if another consumer has picked it up.

If you are on 2003/XP, you cannot do remote receives in a transaction so all bets are off there.

like image 190
Chris Patterson Avatar answered Oct 20 '22 23:10

Chris Patterson