Queue names for WAS hosted WCF service

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 msdn article talks about this behavior. In a nutshell “It’s…


Performance optimization when using MSMQ with WCF

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 Optimizing MSMQ article. Another good reference is Best Practices for Queued Communication. This article also talks about how you can use WCF and MSMQ to…


Checklist for using MsmqIntegrationBinding

The MsmqIntegrationBinding 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. The operation contract should be one-way i.e. IsOneWay = true. Action property should be specified in the operation contract to indicate a service operation handles all messages that the service…


A double negative System.Messaging exception

        Message message = new Message();        message.CorrelationId = Guid.NewGuid().ToString(); The above code snippet compiles but when you execute it, you get a System.InvalidOperationException with an ambiguous message:”Identifier is not in the incorrect format.” There is a typo in the exception above and it should actually say:”Identifier is not in the CORRECT format.” The InvalidOperationException is thrown…

1

WAS hosting on Windows 7

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…


JMS and MSMQ interoperability

I have come across this question of 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 product or implement your own JMS provider. I came across an interesting article called Enterprise Messaging…

1

MSMQ and WCF: Getting Started

Windows Communication Foundation (WCF) provides a powerful programming model to develop service-oriented applications. MSMQ integrates very well with WCF so queued applications can be developed using WCF. WCF provides two bindings that support MSMQ – NetMsmqBinding and MsmqIntegrationBinding. NetMsmqBinding provides asynchronous communication between WCF endpoints. The MsmqIntegrationBinding enables a WCF endpoint to communicate with an…

1

How to count messages in a MessageQueue

There are a few different ways of getting a count of the number of messages in the MessageQueue. Here’s a simple one.        public static int GetMessageCount(MessageQueue q)        {            int messageCount = 0;              using (MessageEnumerator messageEnumerator = q.GetMessageEnumerator2())            {                while (messageEnumerator.MoveNext())                {                    messageCount++;                }            }             …