.NET Framework Bookmark and Share   
 index > Windows Communication Foundation > MsmqIntegrationBinding question
 

MsmqIntegrationBinding question

I have messages in an MSMQ queue and I would like to pick these up to process from a WCF service.

So, on the service side if I setup my binding to point to the queue and then have this associated with a single operation, will the service automatically pull the messages out of the queue as they arrive?

I'm wondering if this is the case, is each message given a single instance of the service (assume the setting is PerCall).

Thanks!

EM

Etowah_man

There are two bindings in WCF that use MSMQ as the underlying transport:

1. NetMsmqBinding : used for communication between two WCF applications.

2. MsmqIntegrationBinding : used for communication between a WCF app and a native MSMQ app (i.e which uses the MSMQ C/COM or System.Messaging APIs).

From the scenario you describe, it looks like you are leaning towards (1)? In that case, the developer experience should be agnostic of the transaport being used underneath. For the server side, you will define and implement a contract and host the service on an endpoint that uses the NetMsmqBinding. For hte client side, you will create a proxy off of this endpont and call methods on this proxy just like you do with other bindings.

Affan Dar - MSFT

No, actually its the other way.

I will have an MQSeries process that sends messages to the MSMQ queue. So, I'm thinking here that I would need to use the MsmqIntegrationBinding.

But, come to think of it, if I could have the MQSeries process posting to a private queue (same queue as for the NetMsmqBinding), then I should just be able to pick it up this way. The message sent into the queue is not really an MSMQ message type, its just an XML document.

EM

Etowah_man

In that case you will need to use the MsmqIntegrationBinding. The NetMsmqBinding assumes a certain framing protocol and serialization in the MSMQ message body which is only done if the sender is NetMsmqBinding as well.

So to answer your question: yes it is possible for the service to pick up messages from an MSMQ queue using the MsmqIntegrationBinding in this scenario. If the instancing is PerCall then every message will have its own service instance.

However, using the MsmqIntegrationBinding does put some constraints on the service contracts that you can use on top of this binding. Here's a blog that I found that has some details on this:

http://blogs.conchango.com/simonevans/archive/2007/09/17/A-comprehensive-guide-to-using-MsmqIntegrationBinding-with-MSMQ-3.0-in-WCF.aspx

For details about the integration binding elements you can lookup MSDN.

Thanks

Affan Dar - MSFT

Here is a sample I ran across:

http://codeidol.com/csharp/indigo/Legacy-Integration/Exposing-a-COM-Component-as-a-WCF-Web-Service/

It's been about 1 year, but I think I used it as a starter for getting a non wcf msmq message into wcf.

I didn't relook at it with fresh eyes though. The other solutions are probably better, but I'll list it anyways.

..

sholliday

You can use google to search for other answers

Custom Search

More Threads

• Allow Only Given IP Ranges Machines to Access WCF Service
• Problem in ServiceHost.Open
• Application Error in Data Provisioanl Service
• Duplex Contract in WCF
• Windows Authentication for a Service hosted in a WPF Application
• Propagate enum members attributes to proxy classes
• Set instanceContextIdleTimeout programmatically?
• WCF authentification - receive my exception on client side
• SvcUtil generated proxy issue
• how to retain state in WCF servcies