1

I have some experience with WCF services development but with this requirement I want to get some help/suggestion from some of the experienced developers here. Here is my scenario,

I will have a service(REST) (let calls it Service 1) which will receive requests from a different service (lets calls it Service Main)with some parameters. I am planing to save these parameters in a database so that I can track the status of the progress in future steps. Then I have to a start a process on the server from Service 1 which will run for in determinant time (based on the parameters) and lets call this process A. When process A is done with its task and comes back with good results then I have to start a different process which is called Process B which will use files generated by process A. When process B is done with its business and sends an acknowledgement to service 1 then I have to send the information back to Service Main.

For database i am planing to use no sql database since there are no relationships involved and it is more like a cache. I am having hard time on how to architect this entire process so that all of these steps/tasks run asynchronous and able to scale and handle lot of requests.

Approach 1: My initial idea was to have a wcf or ASP.NET Web api service(REST) use TPL framework to launch process A and wait for it to complete and call async callback method of process A then launch Process B on a new Task. But I am not sure if that is a good solutions or even possible.

Approach 2: After lot of reading i thought may be having a windows service on the hosted server to launch process A and process B. WCF service will talk to window service to start the process.

Hopefully I explained the problem clearly and waiting to hear some advises.

Csharp
  • 2,916
  • 16
  • 50
  • 77
tik
  • 11
  • 1
  • 1
    If Process A and B are the same and execute always in the same order, you can call a batch file to handle execute order. – Francis Oct 11 '13 at 16:23
  • @Francis Process A and Process B are two different applications,but Process A precedes Process B all the time. – tik Oct 11 '13 at 16:44
  • I mean, is Process A always the same application? Same thing for Process B? If so, Service1 can just launch the batch file calling Process A then Process B on a thread and notify when the job is done. – Francis Oct 11 '13 at 18:15
  • How can each process communicate back to the service if they run from a batch file ? – tik Oct 11 '13 at 18:58
  • Can you sketch a diagram of this ?? would be so easier to understand.... – ilansch Oct 15 '13 at 07:09
  • Are you waiting for a result or only want to know when it completes? – Francis Oct 18 '13 at 12:50
  • Take a look at http://stackoverflow.com/questions/361097/c-sharp-service-cannot-execute-batch-file where you can find how to execute a batch file from C# code and you can wait for the process to end before notifying your client. – Francis Oct 18 '13 at 12:51

0 Answers0