Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Threads versus instances, handling MSMQ

Status
Not open for further replies.

jwhite68

IS-IT--Management
Jun 14, 2007
77
BG
I am building an application in C# that will manage many thousands of incomming messages. This will be managed with MSMQ - message queues.

I would like to know whether its better to create a new instance of the main process (component) for every message received or whether to have just one instance that will spawn new threads as soon as messages are recieved to process a particular message.

Assuming that hundreds of thousands of messages could ce received and processed, just trying to understand whether single instance, multiple threads is a better route than multiple instances.

Thoughts?
 
check out NServiceBus. This project solves the problem you are describing. I believe there is also MassTransit which solves the same problem, but it's still in it's infancy.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Are you talking about multi-threading the writing to the MSMQ, or the reading from it?

Because when reading from it, you can use the standard asynchronous programming model that the framework gives you, and you'll be in good shape, performance-wise.

Be aware that multi-threading means that some of your messages will be processed out of order.

Chip H.


____________________________________________________________________
www.chipholland.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top