<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Motley Queüe</title><subtitle type="html">Queuing At Microsoft</subtitle><id>http://blogs.msdn.com/b/motleyqueue/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/motleyqueue/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/motleyqueue/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2009-06-08T00:02:00Z</updated><entry><title>Queue names for WAS hosted WCF service</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/motleyqueue/archive/2010/04/09/queue-names-for-was-hosted-wcf-service.aspx" /><id>http://blogs.msdn.com/b/motleyqueue/archive/2010/04/09/queue-names-for-was-hosted-wcf-service.aspx</id><published>2010-04-10T01:13:00Z</published><updated>2010-04-10T01:13:00Z</updated><content type="html">On WCF forums, I have noticed a common issue that developers face when hosting their WCF service in WAS. The issue is that the service does not get activated. Often, the reason is that the queue name does not match the service endpoint name. This &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163357.aspx" title="WAS activation" mce_href="http://msdn.microsoft.com/en-us/magazine/cc163357.aspx"&gt;msdn article&lt;/a&gt; talks about this behavior. In a nutshell “It's important to note that the activation of MSMQ endpoints only works correctly if the queue has the same name as the .svc file (minus the machine name). That means that if your service endpoint is /server/app/service.svc, the queue name must be app/service.svc.” This is a pre-requisite for using WAS for hosting WCF services that interact with MSMQ.&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9993537" width="1" height="1"&gt;</content><author><name>Devang Gandhi</name><uri>http://blogs.msdn.com/degandhi/ProfileUrlRedirect.ashx</uri></author><category term="wcf" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/wcf/" /><category term="WAS hosting" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/WAS+hosting/" /></entry><entry><title>Performance optimization when using MSMQ with WCF</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/motleyqueue/archive/2010/04/02/performance-optimization-when-using-msmq-with-wcf.aspx" /><id>http://blogs.msdn.com/b/motleyqueue/archive/2010/04/02/performance-optimization-when-using-msmq-with-wcf.aspx</id><published>2010-04-03T04:06:00Z</published><updated>2010-04-03T04:06:00Z</updated><content type="html">&lt;p&gt;There are a number of factors that can affect the performance of your enterprise application that uses MSMQ with WCF. Nicholas Allen discusses some of these design decisions in his &lt;i&gt;&lt;a href="http://blogs.msdn.com/drnick/archive/2007/05/07/optimizing-msmq.aspx" title="Optimizing MSMQ" mce_href="http://blogs.msdn.com/drnick/archive/2007/05/07/optimizing-msmq.aspx"&gt;Optimizing MSMQ&lt;/a&gt;&lt;/i&gt; article.&lt;/p&gt;&lt;p&gt;Another good reference is &lt;i&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms731093.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms731093.aspx"&gt;Best Practices for Queued Communication&lt;/a&gt;&lt;/i&gt;. This article also talks about how you can use WCF and MSMQ to implement the Request-Reply enterprise messaging pattern.&lt;br&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9989917" width="1" height="1"&gt;</content><author><name>Devang Gandhi</name><uri>http://blogs.msdn.com/degandhi/ProfileUrlRedirect.ashx</uri></author><category term="wcf" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/wcf/" /></entry><entry><title>Checklist for using MsmqIntegrationBinding</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/motleyqueue/archive/2010/03/31/checklist-for-using-msmqintegrationbinding.aspx" /><id>http://blogs.msdn.com/b/motleyqueue/archive/2010/03/31/checklist-for-using-msmqintegrationbinding.aspx</id><published>2010-03-31T19:58:00Z</published><updated>2010-03-31T19:58:00Z</updated><content type="html">&lt;P&gt;The &lt;A title=MsmqIntegrationBinding href="http://msdn.microsoft.com/en-us/library/system.servicemodel.msmqintegration.msmqintegrationbinding.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.servicemodel.msmqintegration.msmqintegrationbinding.aspx"&gt;MsmqIntegrationBinding&lt;/A&gt; allows users to create WCF applications that send and receive messages to and from existing MSMQ applications that use System.Messaging or other MSMQ APIs. &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The operation contract should be &lt;A title="one-way contract" href="http://msdn.microsoft.com/en-us/library/ms733035.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms733035.aspx"&gt;one-way&lt;/A&gt; i.e. IsOneWay = true.&lt;/LI&gt;
&lt;LI&gt;&lt;A title=Action href="http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontractattribute.action.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontractattribute.action.aspx"&gt;Action&lt;/A&gt;&amp;nbsp;property should be specified in the operation contract to indicate a service operation handles all messages that the service receives but cannot be directed to a service operation i.e. Action="*".&lt;/LI&gt;
&lt;LI&gt;The service operation should take a single argument &lt;A title=MsmqMessage href="http://msdn.microsoft.com/en-us/library/ms600458.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms600458.aspx"&gt;MsmqMessage&amp;lt;T&amp;gt;&lt;/A&gt;, where T is a serializable type. You can use the [Serializable] attribute in front of the class definition or use a WCF data contract.&lt;/LI&gt;
&lt;LI&gt;Type T should be specified using the &lt;A title=ServiceKnownType href="http://msdn.microsoft.com/en-us/library/system.servicemodel.serviceknowntypeattribute.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.servicemodel.serviceknowntypeattribute.aspx"&gt;ServiceKnownType&lt;/A&gt; attribute on the service contract e.g. [ServiceKnownType(typeof(PurchaseOrder))].&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;[ServiceContract(Namespace = "&lt;A href="http://microsoft.servicemodel.samples/"&gt;http://Microsoft.ServiceModel.Samples&lt;/A&gt;")]&lt;BR&gt;[ServiceKnownType(typeof(PurchaseOrder))]&lt;BR&gt;public interface IOrderProcessor&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [OperationContract(IsOneWay = true, Action = "*")]&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void SubmitPurchaseOrder(MsmqMessage&amp;lt;PurchaseOrder&amp;gt; msg);&lt;BR&gt;}&lt;BR&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9988334" width="1" height="1"&gt;</content><author><name>Devang Gandhi</name><uri>http://blogs.msdn.com/degandhi/ProfileUrlRedirect.ashx</uri></author><category term="wcf" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/wcf/" /></entry><entry><title>A double negative System.Messaging exception</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/motleyqueue/archive/2010/03/23/a-double-negative-system-messaging-exception.aspx" /><id>http://blogs.msdn.com/b/motleyqueue/archive/2010/03/23/a-double-negative-system-messaging-exception.aspx</id><published>2010-03-23T07:35:00Z</published><updated>2010-03-23T07:35:00Z</updated><content type="html">&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Message message = new Message();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message.CorrelationId = Guid.NewGuid().ToString();&lt;/P&gt;
&lt;P&gt;The above code snippet compiles but when you execute it, you get a System.InvalidOperationException with an ambiguous message:&lt;BR&gt;&lt;EM&gt;"Identifier is not in the incorrect format."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;There is a typo in the exception above and it should actually say:&lt;BR&gt;&lt;EM&gt;"Identifier is not in the&amp;nbsp;CORRECT format."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;The InvalidOperationException is thrown because the &lt;A title=system.messaging.message.correlationid href="http://msdn.microsoft.com/en-us/library/system.messaging.message.correlationid.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.messaging.message.correlationid.aspx"&gt;CorrelationId&lt;/A&gt; property cannot be assigned just any string. It takes a string value in a specific&amp;nbsp;format, the same as that of the &lt;A title=system.messaging.message.id href="http://msdn.microsoft.com/en-us/library/system.messaging.message.id.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.messaging.message.id.aspx"&gt;Id&lt;/A&gt; property of System.Messaging.Message. The following code executes successfully.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Message message1 = new Message();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Message message2 = new Message();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message1.CorrelationId = message2.Id;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9983456" width="1" height="1"&gt;</content><author><name>Devang Gandhi</name><uri>http://blogs.msdn.com/degandhi/ProfileUrlRedirect.ashx</uri></author><category term="system.messaging" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/system-messaging/" /></entry><entry><title>Dealing with PRIVATE= formatnames</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/motleyqueue/archive/2010/03/20/dealing-with-private-formatnames.aspx" /><id>http://blogs.msdn.com/b/motleyqueue/archive/2010/03/20/dealing-with-private-formatnames.aspx</id><published>2010-03-20T18:20:00Z</published><updated>2010-03-20T18:20:00Z</updated><content type="html">&lt;P&gt;If your MSMQ environment has AD Integration installed, you can use PUBLIC= formatnames for public queues and PRIVATE= formatnames for private queues. PUBLIC= formatnames are pretty easy to work with: if you know the path of the queue, you can get or construct a PUBLIC= formatname, and if you have a PUBLIC= formatname, you can get the path of the queue.&lt;/P&gt;
&lt;P&gt;PRIVATE= formatnames aren't so easy. You can't construct a PRIVATE= formatname, the way you can a PUBLIC= formatname. The syntax of&amp;nbsp;the formatname is PRIVATE=&lt;EM&gt;qmguid&lt;/EM&gt;\&lt;EM&gt;queueID&lt;/EM&gt;.&amp;nbsp;You can get the&amp;nbsp;&lt;EM&gt;qmguid&lt;/EM&gt;, which identifies the queue manager hosting the queue, but the &lt;EM&gt;queueID&lt;/EM&gt; is a number internal to the queue manager, and the only way to get it is by extracting it from a&amp;nbsp;PRIVATE= formatname. It is not exposed as a queue property.&lt;/P&gt;
&lt;P&gt;So, if you have the path to a private queue and you want a PRIVATE= formatname, what can you do? If it's a local queue, you can pass the path to MQPathNameToFormatName and it should return a PRIVATE= formatname. If it's not a local queue, you're out of luck. I was actually bitten by this while writing a test, and the only solution I found was to write a a little program which runs on the remote machine, performs the MQPathNameToFormatName call, and saves the result somewhere where the rest of the test can get at it!&lt;/P&gt;
&lt;P&gt;It's a little easier if you have a PRIVATE= formatname and want to get the path of the queue. Start out by calling MQGetQueueProperties with the formatname and retrieving the PROPID_Q_PATHNAME property. If it's a local queue, you're done; if not, you'll get an error back and&amp;nbsp;it gets complicated. First, you have to figure out what machine the queue is on! You can extract the &lt;EM&gt;qmguid&lt;/EM&gt; from the formatname and pass it to MQGetMachineProperties, retrieving the PROPID_QM_PATHNAME property, which gives you the name of the remote computer. That gives you one of the inputs required for MQMgmtGetInfo, and the other one is QUEUE=&lt;EM&gt;formatname&lt;/EM&gt;. Call MQMgmtGetInfo to retrieve the PROPID_MGMT_QUEUE_PATHNAME, and if the queue is "active", you'll have the path.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9982406" width="1" height="1"&gt;</content><author><name>James Birdsall</name><uri>http://blogs.msdn.com/James-Birdsall/ProfileUrlRedirect.ashx</uri></author><category term="basics" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/basics/" /></entry><entry><title>Configuring a Remote WAS-hosted Queue</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/motleyqueue/archive/2010/03/13/configuring-a-remote-was-hosted-queue.aspx" /><id>http://blogs.msdn.com/b/motleyqueue/archive/2010/03/13/configuring-a-remote-was-hosted-queue.aspx</id><published>2010-03-13T01:49:00Z</published><updated>2010-03-13T01:49:00Z</updated><content type="html">&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Creating a reliable service for MSMQ has been made simpler with the introduction of Windows Process Activation Service (WAS). Your deployment scenario may make it easier to have WAS running on a separate machine from where the MSMQ queue of interest is located. This post will go through the steps to get a simple sample running under these circumstances. We will be assuming setup through the IIS manager GUI for the instructions.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Here are the steps:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 38.25pt; mso-list: l0 level1 lfo1" class=MsoListParagraph&gt;&lt;SPAN style="mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;1.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Create a queue on the ‘remote’ machine.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 38.25pt; mso-list: l0 level1 lfo1" class=MsoListParagraph&gt;&lt;SPAN style="mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;2.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Create (or edit) a site in WAS to use for your application on the ‘server’ machine. Each site can only read queues from &lt;I&gt;one &lt;/I&gt;logical machine.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 38.25pt; mso-list: l0 level1 lfo1" class=MsoListParagraph&gt;&lt;SPAN style="mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;3.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Bring up the ‘Edit Bindings’ dialog for the site. Add (or edit) the net.msmq or msmq.formatname entry, setting the ‘Binding Information’ field to the name of the computer that will host the queue. For locally hosted queues, this field is usually set to ‘localhost’.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 38.25pt; mso-list: l0 level1 lfo1" class=MsoListParagraph&gt;&lt;SPAN style="mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;4.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Create your application as you normally would – add your code, service file etc. Ensure that the NetMsmqBinding or MsmqIntegrationBinding that is being used for your service has the address of the remote queue (e.g. “net.msmq://remote-machine/private/myapplication/myservice.svc”).&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 38.25pt; mso-list: l0 level1 lfo1" class=MsoListParagraph&gt;&lt;SPAN style="mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;5.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Go to the Advanced Settings of your application. Under ‘Behavior’, edit the Enabled Protocols field to add in your MSMQ protocol of choice (comma separated, e.g. “http,net.msmq”).&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 38.25pt; mso-list: l0 level1 lfo1" class=MsoListParagraph&gt;&lt;SPAN style="mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;6.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Ensure that MSMQ is allowed through your firewall on &lt;I&gt;both &lt;/I&gt;machines. If you’re using transactions, ensure that Distributed Transaction Coordinator (MSDTC) is also allowed through the firewall.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -20.25pt; MARGIN: 0in 0in 0pt 40.5pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;6a.&amp;nbsp;&amp;nbsp; If you’re using transactions, you’ll need to allow network access for MSDTC on both machines. If you run the command ‘dcomcnfg’, then go ‘Component Services’ -&amp;gt; ‘Computers’ -&amp;gt; ‘My Computer’ -&amp;gt; ‘Distributed Transaction Controller’ -&amp;gt; ‘Local DTC’ -&amp;gt; ‘Properties’ -&amp;gt; ‘Security’ tab, there are appropriate settings there.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 38.25pt; mso-list: l0 level1 lfo1" class=MsoListParagraph&gt;&lt;SPAN style="mso-fareast-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;7.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;By default, both the application pools and the listener service (called “Net.Msmq Listener Adapter” in the services pane) run under the ‘Network Service’ account. Both of these applications require access to the queue, so ensure that the appropriate users are given access to read from the queue.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;This should be enough to get your application running. If you’re anything like me, sometimes it doesn’t ‘just work’. So here’s some simple troubleshooting steps to point you in the right direction:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraph&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;From an elevated command prompt, restart the listener adapter by using the commands ‘net stop netmsmqactivator’ and ‘net start netmsmqactivator’. It can take up to ten minutes for WAS to detect changes in queues, so this should force WAS to recheck the queues.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraph&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Enable metadata exchange for your service. This involves enabling HTTP in the ‘Enabled Protocols’ of your site, and adding the following text to your config file (merging with existing sections, where necessary):&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 1in" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&amp;lt;system.serviceModel&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 1in" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;behaviors&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 1in" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;serviceBehaviors&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 1in" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;behavior name="MyBehavior"&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 1in" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;serviceDebug includeExceptionDetailInFaults="true" /&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 1in" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;serviceMetadata httpGetEnabled="true" /&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 1in" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/behavior&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 1in" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/serviceBehaviors&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 1in" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/behaviors&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 1in" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&amp;lt;/system.serviceModel&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 1in" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.5in; MARGIN: 0in 0in 0pt 0.5in" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ensure that the behavior “MyBehavior” gets added to the &amp;lt;service&amp;gt; tag as ‘behaviorConfiguration=”MyBehavior”’. Now browse to your service file. This can be done by finding the service file in the IIS manager view and clicking ‘Browse’. If the metadata doesn’t come up successfully (so you get a HTTP error or an exception), there is a problem with your service that you’ll need to resolve first.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraph&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Try to give the accounts ‘Everyone’ and ‘Anonymous’ full control of your queue. If the service begins working, it is probably a security issue.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l1 level1 lfo2" class=MsoListParagraph&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Try to disable your firewall on both machines. If it begins working at this point, the exceptions in your firewall are not correctly configured.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;--Nathan Healey&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="COLOR: #953735"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9977881" width="1" height="1"&gt;</content><author><name>James Birdsall</name><uri>http://blogs.msdn.com/James-Birdsall/ProfileUrlRedirect.ashx</uri></author><category term="wcf" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/wcf/" /><category term="WAS hosting" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/WAS+hosting/" /></entry><entry><title>Queue Matching Behavior in WAS</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/motleyqueue/archive/2010/02/24/queue-matching-behavior-in-was.aspx" /><id>http://blogs.msdn.com/b/motleyqueue/archive/2010/02/24/queue-matching-behavior-in-was.aspx</id><published>2010-02-24T03:40:00Z</published><updated>2010-02-24T03:40:00Z</updated><content type="html">&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;With the release of Windows Vista (and subsequently Windows Server 2008), a new way to host WCF services was introduced: Windows Process Application Service (WAS). Services that use MSMQ now have the option of being &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ms734677.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms734677.aspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;hosted in WAS&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt;. One of the most frequently asked questions relates to matching the service file (*.svc file) with the queue that needs to be monitored. &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ms789042.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms789042.aspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;This article&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; explains most of the behavior, but this blog post aims to clarify some of the subtleties. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;The queue is matched using two criteria: the &lt;I&gt;virtual directory&lt;/I&gt; and the &lt;I&gt;service file name&lt;/I&gt;. The virtual directory is the directory structure below the ‘wwwroot’ folder in the IIS directory. For example, if the path for a service file is ‘&lt;I&gt;C:\inetpub\wwwroot\MyServices\ExampleService\ExampleService.svc&lt;/I&gt;’, the virtual directory is ‘MyServices/ExampleService/’. The service file name is the full name of the file, including the .svc extension. In this trivial example, the matching queue could be named ‘MyServices/ExampleService/ExampleService.svc’.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;A complication arises when WAS discovers a service file in a virtual directory, whereby it considers all queues in that same virtual directory to be related to a service. If, in the previous example, there was a second queue named ‘MyServices/ExampleService/AnotherService’, this would cause an error. This queue can’t possibly match a service file (due to the lack of .svc extension), but is in an application virtual directory that has a service. This seems an unlikely scenario – any other virtual directory (or none at all) in the name of the queue would avoid this altogether.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;This behavior may become problematic when you consider the &lt;I&gt;root&lt;/I&gt; application – when the service file is placed directly into the wwwroot folder. The queue name now only has to match the service file name, as no virtual directory is appended. For example, a service file in ‘&lt;I&gt;C:\inetpub\wwwroot\NewExampleService.svc&lt;/I&gt;’ would match a queue named ‘NewExampleService.svc’. WAS now considers the root virtual directory to contain a service. Any queue present on the machine that does not contain a forward slash (‘/’) and doesn’t match a service file will cause an error in WAS! &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Queues that are not used by WAS rarely contain forward slash characters. It is important to consider this scenario when designing your system. Avoid placing services directly into the root directory, if possible. Only do so if the system will only ever have queues that are associated with WAS hosted services.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;--Nathan Healey&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9968459" width="1" height="1"&gt;</content><author><name>James Birdsall</name><uri>http://blogs.msdn.com/James-Birdsall/ProfileUrlRedirect.ashx</uri></author><category term="WAS hosting" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/WAS+hosting/" /></entry><entry><title>WAS hosting on Windows 7</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/motleyqueue/archive/2010/01/20/was-hosting-on-windows-7.aspx" /><id>http://blogs.msdn.com/b/motleyqueue/archive/2010/01/20/was-hosting-on-windows-7.aspx</id><published>2010-01-20T09:03:00Z</published><updated>2010-01-20T09:03:00Z</updated><content type="html">&lt;P&gt;IIS 7 allows isolation of web application pools from each other by providing the ability to run application pools as separate identities. The identity of an application pool is the name of the service account under which the application pool's worker process runs. Running an application pool under an account that has high-level user rights is a serious security risk. The application pools run under an unique account without having to create and manage domain or local accounts. The name of the application pool account corresponds to the name of the application pool.&amp;nbsp;The ApplicationPoolIdentity can also be used as the account for Anonymous Authentication. &lt;/P&gt;
&lt;P&gt;Application pools in IIS 7 run as "NetworkService" by default. NetworkService is a built-in Windows identity. In Windows 7 (IIS 7.5), the default&amp;nbsp;identity of an IIS application pool is "ApplicationPoolIdentity".&amp;nbsp;When WAS hosting your WCF service using NetMsmqBinding or MsmqIntegrationBinding,&amp;nbsp;remember to&amp;nbsp;grant "Receive Message" permission&amp;nbsp;to&amp;nbsp;"IIS APPPOOL\DefaultAppPool" on the MSMQ queue that the service is listening on. Here "IIS APPPOOL\DefaultAppPool" is nothing but "IIS APPPOOL\&lt;EM&gt;&amp;lt;name of the application pool on which your application is deployed&amp;gt;&lt;/EM&gt;". Depending on your application, you may also need to configure the application pool to load the user profile by setting the "LoadUserProfile" setting to "true".&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9950734" width="1" height="1"&gt;</content><author><name>Devang Gandhi</name><uri>http://blogs.msdn.com/degandhi/ProfileUrlRedirect.ashx</uri></author><category term="wcf" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/wcf/" /><category term="WAS hosting" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/WAS+hosting/" /></entry><entry><title>MSMQ and the Windows Firewall</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/motleyqueue/archive/2009/06/15/msmq-and-the-windows-firewall.aspx" /><id>http://blogs.msdn.com/b/motleyqueue/archive/2009/06/15/msmq-and-the-windows-firewall.aspx</id><published>2009-06-16T01:28:00Z</published><updated>2009-06-16T01:28:00Z</updated><content type="html">&lt;P&gt;I was called on to assist&amp;nbsp;recently in diagnosing why an MSMQ client was unable to send messages to a queue on a server. One of the things the owner of the machines did was take a network trace on the client of the connection attempt, and what I saw there sent me down the wrong path for a while due to the way MSMQ interacts with the Windows Firewall. To save everyone else the trouble, I thought I'd discuss how the MSMQ installation sets up the firewall to work with MSMQ and why I went astray.&lt;/P&gt;
&lt;P&gt;The application in question was using MSMQ's native protocol, so the client was attempting to make a TCP connection to port 1801 on the server. When the client sends the first packet to start the connection process, one of three things will usually happen:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The server receives the packet, and a process (MSMQ's Queue Manager) is listening on port 1801, so the server sends a reply which continues the connection process.&lt;/LI&gt;
&lt;LI&gt;The server receives the packet but no process is listening on port 1801, so the server sends a reply which aborts the connection process.&lt;/LI&gt;
&lt;LI&gt;The server doesn't receive the packet, so there is no reply. The client tries a couple more times, then the connection process times out.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;When I looked at the network trace, I could see the client making multiple attempts to start a connection to port 1801 on the server, and the server was not sending back any replies to those attempts, indicating that&amp;nbsp;the network stack on the server&amp;nbsp;wasn't receiving the packets at all. The client had no problem making other kinds of connections to the server, so we knew that the server's networking in general was OK. Selective deafness like that is usually the result of firewall problems, so we briefly went on a wild goose chase looking at the MSMQ-related firewall rules, only to find that they were present and enabled, just as they should be.&lt;/P&gt;
&lt;P&gt;Here's the critical bit: when we think of firewalls, we normally think of opening ports, but that is not how the MSMQ installer sets up the firewall rules for MSMQ. Instead, it "whitelists" the mqsvc.exe process for certain network protocols, meaning that (for example) any TCP port which mqsvc.exe opens to listen on causes the firewall to automatically allow packets to that port. This approach was taken because the ports MSMQ uses aren't 100% fixed. This is particularly true of the ports it uses for RPC: MSMQ will automatically use alternate ports if its first-choice defaults are already in use. Other ports can be changed by the use of registry keys. By using these whitelist firewall rules, the firewall automatically adapts to whatever ports MSMQ uses, minimizing surprises and complexity.&lt;/P&gt;
&lt;P&gt;The breakthrough in our diagnosing came when we discovered that MSMQ wasn't listening on port 1801, or any of its other usual ports, which quickly led us to discover that it had been inadvertently configured in hardened mode, in which it will only accept messages via HTTP. Since it wasn't listening on port 1801, the firewall wasn't allowing packets to that port, giving the appearance of a firewall problem even though it was doing exactly what we'd asked it to do.&lt;/P&gt;
&lt;P&gt;The moral of the story is that,&amp;nbsp;because of the way the MSMQ firewall rules are set up,&amp;nbsp;what appears to be a firewall problem can be a symptom of issues elsewhere. Before you spend too much time staring at the firewall, check that MSMQ is listening on the expected address and port combinations.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9756211" width="1" height="1"&gt;</content><author><name>James Birdsall</name><uri>http://blogs.msdn.com/James-Birdsall/ProfileUrlRedirect.ashx</uri></author><category term="troubleshooting" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/troubleshooting/" /></entry><entry><title>JMS and MSMQ interoperability</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/motleyqueue/archive/2009/06/08/jms-and-msmq-interoperability.aspx" /><id>http://blogs.msdn.com/b/motleyqueue/archive/2009/06/08/jms-and-msmq-interoperability.aspx</id><published>2009-06-08T10:02:00Z</published><updated>2009-06-08T10:02:00Z</updated><content type="html">&lt;P&gt;I have come across this question of&amp;nbsp;whether JMS and MSMQ are interoperabe a number of times and so I decided to address it. Microsoft does not have a JMS provider for MSMQ so basically you will need to use a third party&amp;nbsp;product or implement your own JMS provider. &lt;/P&gt;
&lt;P&gt;I came across an interesting article&amp;nbsp;called&amp;nbsp;&lt;A title="Enterprise Messaging in a Heterogeneous Environment" href="http://www.codeguru.com/csharp/.net/net_general/toolsand3rdparty/article.php/c9407/" mce_href="http://www.codeguru.com/csharp/.net/net_general/toolsand3rdparty/article.php/c9407/"&gt;Enterprise Messaging in a Heterogeneous Environment&lt;/A&gt;. The article describes how to use web services as a proxy between MSMQ and a JMS implementation. The solution effectively implements a custom enterprise message bus using which heterogenous applications (.net and java) can communicate asynchronously with each other.&lt;/P&gt;
&lt;P&gt;Another way of accessing MSMQ from Java applications is to use &lt;A href="http://en.wikipedia.org/wiki/Java_Native_Interface" mce_href="http://en.wikipedia.org/wiki/Java_Native_Interface"&gt;JNI&lt;/A&gt; (Java Native Interface) as described &lt;A href="http://blogs.msdn.com/smguest/archive/2005/03/17/398134.aspx" mce_href="http://blogs.msdn.com/smguest/archive/2005/03/17/398134.aspx"&gt;here&lt;/A&gt;. JNI can be used to call the &lt;A href="http://msdn.microsoft.com/en-us/library/ms707133(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms707133(VS.85).aspx"&gt;C api&lt;/A&gt; that MSMQ exposes, from within Java applications.&lt;/P&gt;
&lt;P&gt;MSDN also has some pointers on &lt;A href="http://msdn.microsoft.com/en-us/library/ms998432.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms998432.aspx"&gt;implementing asynchronous interoperability&lt;/A&gt;.&lt;BR&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9707610" width="1" height="1"&gt;</content><author><name>Devang Gandhi</name><uri>http://blogs.msdn.com/degandhi/ProfileUrlRedirect.ashx</uri></author><category term="MSMQ" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/MSMQ/" /><category term="interoperability" scheme="http://blogs.msdn.com/b/motleyqueue/archive/tags/interoperability/" /></entry></feed>