question

Born2Achieve-5280 avatar image
0 Votes"
Born2Achieve-5280 asked DuaneArnold-0443 commented

Architectural Help + c# console application

Hello,
We have healthcare office in 800 locations and
Right now we have web application and each facility manager click web application button triggers api which does complex backend operation and getting time out some times. to avoid that, i am planning to do this on the c# console application job.

I have a c# console application created and can be scheduled on task scheduler. have 5 servers to deploy this. this batch job calls multiple procs and its does complex operations. so one facility will take 3-4 minutes to finish operation. I cannot do sequential operation like one facility at a time. I need to run this for 800 facilities at a time. This has to happen 5pm everyday for each facility. What is the best way to achieve this scenario from architectural perspective.

dotnet-csharp
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You could look into using Hangfire.

https://www.hangfire.io/

I guess you could implement it in a console program.

Maybe, the Web application needs to offload this processing where it triggers the process async.

You could have an ASP.NET WebAPI execute an exe async. You could take a Windows form program and remove the form making it an exe that runs with no form involved.

https://stackoverflow.com/questions/53431568/call-a-process-asynchronously-via-webapi

You can have 800 WebAPI(s) on a backend Web server that the front-end Web app calls to invoke a async call to an exe, which would have to set the WebAPI timeout.

Those are some options to investigate. You could do some kind of async threads with the console program, but 800 of them I don't know about that. :) A Web server runs multi threaded Web applications.


0 Votes 0 ·

Thanks for the reply. i will play with this approch

0 Votes 0 ·

Are you getting a SQL Server Timeout?

0 Votes 0 ·

1 Answer

karenpayneoregon avatar image
0 Votes"
karenpayneoregon answered

If you are not chasing a quick solution take a look at Quartz.NET scheduling system for .NET. Which we use daily in a windows service where jobs are setup to run via triggers from data in a database. Works with ASP.NET too. Check out the help section to get an idea how this library works.


91035-kpmvp.png



kpmvp.png (2.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.