MSMQ listener with WCF?

Scenario : I want to implement an MSMQ in which users input message through System.Messaging API's. And there should be a listener which always observes this queue so when ever there is a message in queue I want to make a database updation.

My first approach was to implement MSMQ trigger. I was able to implement a COM interop dll trigger. But I wasnt able to do database operation and I couldnt figure out what was wrong, I tried a lot . Then I came to know about this WCF MSMQ binding. As I am new to this WCF I have some doubts.

Which is the best approach to host WCF for this case. Is it IIS with WAS or Windows service?

And for this kind of listener service is a client necessary or can we write the database operations directly under the Service host operations without client invocation?


Then I came to know about this WCF MSMQ binding. As I am new to this WCF I have some doubts

Well, that's valid. WCF has a fairly steep learning curve, is very config-heavy, and is not everyone's cup of tea.

However, if you're integrating to MSMQ, WCF has very good support and is rock solid in terms of the way it is implemented.

Which is the best approach to host WCF for this case. Is it IIS with WAS or Windows service?

Unless you're hosting exclusively on a web environment, I would choose a windows service every time. Using something like topshelf, the deployment and management overhead is tiny, and there are no external dependencies.

Remember to use msmqIntegrationBinding rather than netMsmqBinding, as the latter relies on WCF at both ends, whereas the former supports System.Messaging on the client, or even better, use WCF on the client and then you can use netMsmqBinding which support "typed" messages.

链接地址: http://www.djcxy.com/p/55816.html

上一篇: 使用Heist模板中不是来自应用程序monad的值

下一篇: MSMQ监听与WCF?