tags:

views:

165

answers:

4

I'm trying to decide if MSMQ is the right tool for communication between our application and a third party web service we are currently communicating with directly. We're looking to uncouple this such that if the service goes down, life could still go on as normal.

I can't find anything outside the usual MS fluff about it being the greatest thing and solving all your problems etc etc. It would be really useful if I could find some information that was somewhere between marketing fluff and API - like an architecture diagram of the components and how they integrate with each other, and more importantly how I integrate with them.

It's probably that I'm just looking for the information in the wrong places, so if someone could point me in the right direction, I'd appreciate it.

A: 

MSMQ is a implementation of a message queue as are websphere mq and a bunch of other systems. When looking into the concepts and high level architecture I would suggest reading up on message queue's and how they are applied in disconnected scenario's. I can highly recommend Patterns of Enterprise Application Architecture. For specific examples on msmq check out Pro MSMQ: Microsoft Message Queue Programming it doesn't contain allot of special information but it does group it allot better then most resources available on the internet. This Hello World with MSMQ article would give you a nice overview of what it entails and it's easily executed on a development system.

olle
I've already previously integrated with SonicMQ which is the same kind of concept. What I'm trying to figure out is whether MSMQ is architecturally what I'm looking for.
BenAlabaster
+1  A: 

A typical MSMQ architecture would be composed of 3 parts...

  • Message Queue - This would be on one of your servers. You would have to install the MSMQ bits and create your queue.
  • Client - Your client would insert messages into the queue. I'm assuming you're using .NET. If so, most of what you want is going to be located in the System.Messaging namespace.
  • Windows Service - This would also run on a server, probably the same server as your queue. Its job would be to watch the queue, process messages as they come in, handle making sure the external service is available, and probably do some logging.

Here's an article that should go into a little more detail and give you some code samples.

whatknott
Okay, so from the sound of things, it's a significant amount of work. I've already got a hand rolled design that is ironed out conceptually at least including the edge cases we could think of. If it's significant work to use MSMQ, I'm wondering if it's advantageous to use that over a specialized queue for this application.
BenAlabaster
It isn't much work to install MSMQ, create a queue, and insert messages. The bulk of the work will be in the Windows Service. All of it is very doable though, especially if you're pretty familiar with .NET.
whatknott
Okay, this clarifies what I thought, that I would have to write the windows service that processes the queue as well as the process for queuing up the item. So MSMQ doesn't really actually save me a whole lot of time over using a table in my existing database.
BenAlabaster
A: 

If you are calling a remote web service from your application, it makes sense to use a queue to decouple your application processing from the remote system. By abstracting the communicating through messaging and having a gateway service that is responsible for communication to the web service, you isolate your application from the latency of the web service and build fault tolerance into the design by reducing the request/response usage inside your application (since messaging is by default asynchronous - you deal with it up front).

There are frameworks for .NET that can make this much easier (such as MassTransit or NServiceBus).

You can also check out SOA Patterns (by Arnon Rotem-Gal-Oz, Manning Press, in MEAP) and Enterprise Integration Patterns (Hohpe,Woolf), the latter of which is an essential read for anyone building a message-based system.

Chris Patterson
A: 

Anyone have a good technical reference on MSMQ? I just went through my Richter books and he doesn't cover MSMQ. Either does the Duffy (CPoW). Any pointers appreciated. Craig

Craig
You should really ask this as a separate question so that it gets its own answers and people can vote. Click the Ask A Question button in the top right corner of the page.
BenAlabaster