Publish-Subscribe is such a powerful and useful pattern. IBM’s MQ is one of the best implementation of queue and broker on top of it. This post in intended to help people from the .NET world who are trying take advantage of MQ in their applications.
You can create WCF applications with MQ endpoint, just like MSMQ endpoint. But MQ 7.x offers lot more.
1. All the required components for WCF and MQ 7.x are installed.
2. You have to provide enought information to svcutil to be able generate proxies. In order to do this, you have to edit the configuration file of svcutil.exe. This file can be found in the following folder:
C:Program Files (x86)Microsoft SDKsWindowsv7.0ABin and name of file is: SvcUtil.exe.config. After making the changes it should like this:
3. Build your server application just like you did before. Your configuration for this server should look like this:
4. Now it is time to generate the proxy for the clients to use this service. Make sure that your server application is running. In your client application project choose to add service reference and provide the server URL. This will create some entries in the app.config. But, some entries will be missed and you have to add them manually. Finally, after making those manual edits, configuration file should look like this:
5. For my test application I created a queue manager called ‘QM1’ and a queue called ‘SampleQ’