0

I have the following scenario:

There is a master service, which reads other data services and/or a database in a polling fashion. When a new job becomes available it instructs a "slaver" service to create a new process (not thread!) to work on that particular job, and stores the new process' identifier. Then, if new command regarding that job comes up, it has to send a message (queue?) to that particular process.
To make it more complicated, the "slaver" service may or may not be on the same server as the master service, and the created processes are on the same server as the slaver that created it.
I'm looking for the best way to communicate (simplex with reply) with the processes from the master.

  • It is acceptable if I have to send the messages to the processes via the slaver.
  • It is preferrable if I have to use the same method to reach the local process as the remote process

My preferred tool is WCF, but I haven't used anything more complicated than WsDualHttpBinding...
What are my options? Reliable session? Message Queue?
What binding? NetTcpBinding, NetMsmqBinding, NamedPipes?

TDaver
  • 7,164
  • 5
  • 47
  • 94
  • Could the processes expose IPC WCF endpoints (only accessible on the machine they are running on) or are they comparatively arbitrary processes with no special properties? – Richard Blewett Jun 16 '11 at 17:35
  • @Richard Blewett: they could, but then the only way to communicate with them would be via the slaver. (that is not a problem by itself) How do I specify and endpoint to be IPC? – TDaver Jun 16 '11 at 17:54
  • 1
    You use the NetNamedPipeBinding which uses shared memory named pipes – Richard Blewett Jun 16 '11 at 18:26

1 Answers1

1

I would make each of the launched processes expose a "process control" WCF service exposed using NetNamedPipeBinding (which does not allow off-machine interaction). Then control each of these via it's local Slaver service. This means you have your common model for communication whether the processes are local or remote and you have a standard communication technology in terms of WCF

Richard Blewett
  • 6,089
  • 1
  • 18
  • 23
  • that's approximately the same thing I came up after additional research. Also: between the master and the slaver what is the best thing? I think NetTcpBinding, right? – TDaver Jun 16 '11 at 23:02
  • If you need duplex then definitely NetTcpBinding but otherwise I'd be tempted to stay with HTTP - BasicHttpBinding or a custom binding with Binary encoding over HTTP. NetTcpBinding is inherently sessionful which requires a degree of special handling http://www.dotnetconsult.co.uk/weblog2/PermaLink,guid,af6e6325-2e30-42e3-acb9-57e1363fa51e.aspx – Richard Blewett Jun 17 '11 at 05:37