Quote:
1. I'm new to C#, what is the proper pattern to queue and process them? Should I use ConcurrentQueue and ThreadPool to archive it?
2. What is the proper way to notify user about the job is success/fail? Instead of using callback service, is async an ideal way? My concern is that there may be lots of jobs in the queue and I don't want client suffer from waiting it complete.
3. The web service is placed behind a load balancer, how can I maintain a 'process queue' among them? I've tried using Hangfire and it seems okay, any alternative suggest?
4. How can I know how many jobs are in the Queue/ how may thread is currently running? The webservice will be deployed on IIS, is there a Native way to archive it, or should I implement a web service call to obtain them?
1. There are many different but equally valid ways to solve a problem in programming. As the designer it's up to you to determine which way solves the problem in a way that you can both understand and implement, based on the provided specifications if there are any.
2. Again there is no 'proper way' and if you;re asked ot develop something then the required way should be in the specification. You could use webhooks for call backs, you could use SMS or E-Mail if you're notifying an end user, all valid notification methods depending on the requirements.
3. Hangfire is a great tool, I'm a big fan, alternatively, options such as message queues/busses may also be worth considering.
4. Hangfire or message busses will have a count of jobs in the queue that would be available. You'd need to queries these, IIS would not store this information.
Good luck!