windows services - WCF Communication with Host -


I am writing an application that has a Windows service that needs to be communicated with other Windows services. The "target" service will accept the request from the "source" service and do one thing. The "source" service will not wait for any response, so the request should be returned as early as possible.

The "target" service was to host the WCF service with "source" in there. Once the request has been received, I need to communicate to tell it to work with the host Windows service. I was thinking that the "target" WCF service puts a message on MSMEX, which is the "target" Windows service Once it is done, WCF service can return to the caller.

Is this sound like a sensible approach to telling a hosting Windows service to work the WCF service?

> Kind regards

Michael

I disagree Let it happen. Depending on what you have described, just using MSMQ to communicate between the "target" WCF service and the hosting Windows service, it seems very heavy to me, MSMQ allows different processes to communicate unsuccessfully is. In your case, the WCF service is hosted in the same process as the Windows Service. Thus, while MSMAAs will act as a communication instrument between the two, it is not necessary.

Additionally, it is understandable to use a binding MSMQ between the "target" WCF service and "source" WCF service if two WCF services Not always running at the same time. For example, if the "target" WCF service does not always run, MSMQ binding will still allow the "source" WCF service to send tasks. "Target" WCF service will be stored in MSMQ to recover these tasks when it starts running. However, it seems that both services have to be run, so I can not see the need for MSMQ binding.

To select WCF binding, refer to this SO post.

Let me address one more thing. When your "target" WCF service receives a work request from "source", communicating the work only on Windows service does not mean that nothing is going to do with the Windows service running, yes, but the execution in it There is no thread, which you can avail. The point is that to make work processing asynchronous, you have to start a thread to manage the task (o). I suggest taking advantage of Threadpool to do this.

Hope this will be helpful.

Comments