views:

72

answers:

2

I need a little bit of advise regarding the situation I am faced with. The current arrangement I have been tasked with improving just doesn't sit well with me and I feel like there is a better way to do it. The more I read about WCF, the more I get the feeling that it might be what I am looking for.

Right now, I have an asp.net client, a .net web service, a windows service, a ms sql database, and a third party application that is used for processing a group of 'project' files into a finalized file. Since the third party application can only handle processing one 'project' at a time, the combination of the web service, window service, and database have been arranged to create a job queue manager for the third party application.

The client sends a zip 'project' file containing multiple sub files to the web service. The web service adds a new 'project' line to the database, generating a unique job id. The zip file is expanded to a folder location on the server using the job id as the folder name. The web service then returns the job id to the client. The client will use this id to poll the web service for the status of the job submitted. When the job is complete, the client will request the processed file.

The windows service polls the database every x minutes. If a new job exists, the service will pull the oldest job and send it to the third party app for processing. If the processing succeeds, the window service updates the project line in the database, marking the job complete. The window service will continue to process any non complete jobs in the database until there are no more. When it stops finding any jobs, it will sleep x minutes and then poll the database again.

I do not like the fact that the window service has to poll the database. If there is only one job submitted, the client will have to wait for the window service to poll and then wait while the 'project' is being processed. It seems like WCF could be used to combine the web and window services using a combination of the InstanceContextMode.Single and ConcurrencyMode.Multiple. So far, I have been unable to find any articles or examples that would point me in the right direction. Can WCF be utilized to accomplish the job queue logic of the current arrangement in a better way? As always, any help is more than appreciated.

A: 

I know, this is no answer to your question, but if the delay (until a single job gets processed) is your only major concern with the current solution, then why not simply decrease the polling interval (e.g. to 10 seconds)?

Is there a problem with polling, or is it just that you don't like this solution?

M4N
I'm just not happy with that solution. I've been looking into replacing the web service with a wcf service to make use of channel chunking for large file transfers. I am hoping I can rework the window service out of the picture and remove its polling in the process. Right now the current architecture is used by only the current web client. It is about to get a lot more use as future systems come online.
gun_shy
A: 

I need to create a similiar app. Did you find a solution.

Ron
Nothing as of yet. I do not have the resources to pursue WCF without much indication of its ability to apply to the situation. Hopefully, someone will stumble upon this question or I will find time to find out for myself.
gun_shy