Click here to Skip to main content
13,597,887 members
Rate this:
Please Sign up or sign in to vote.
See more:

I've a question: In case of multiple consumers (identical service) are listening/receiving messages from the only one MSMQ queue, do I need to lock the queue on Receiving message? To make sure that a message was processed only once.

In the other words, is it possible if two instances of a service running on two machines, competing on the same queue, getting the same message?

Your answer is greatly appreciated.
Posted 9-Jul-15 20:29pm
virusstorm 10-Jul-15 7:56am
I'm curious about what you are trying to achieve. What is the goal of having two applications read from a single queue?
masilver 19-Jul-17 9:30am
This is extremely useful and many (most?) messaging queues offer this. It's ideal if you want to have multiple applications processing queue items in parallel. For example, sending emails, or making a web spider, etc. If you can only have one consumer, you'll always be limited by that consumer's speed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.180621.3 | Last Updated 10 Jul 2015
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100