views:

436

answers:

1

Is there an easy way for a IJob to publish data from within the Job. I have a Job running an import process, but would like to retrieve the progress by looking up the Job and requesting it.

I thought that i may be able to use the JobDetails, but does not seem to reflect the changes made within the Job?

+1  A: 

There isn't a built-in way that would give you easily the thing you are looking for. But it isn't that hard to publish progress info to some other facility via publish subscribe either. You could also periodically write progress info to persistent storage - that would also give you the benefit of easy retry when you know the last successful bit that was processed.

An outside thread/process could also determine the status if it polled the target where you are importing and you would have somewhere the info about total items that are going to be imported.

Quartz.NET jobs are units that are processed as an.. well unit and so there isn't the notion of how much there is yet to be done. Or do you need this info in another job that depends on import process?

Marko Lahma
Makes sense... I need to update a gui via a webservice call which in turn needs to see the process of a particular job? May need to re-architect the solution a bit. Thinking of using a static list of sort to store the respective status/progress of all running jobs.
Jan de Jager
Yes, this all depends on the amount of jobs you have etc. In small deployments with manageable amount of triggers/jobs you could get by by just polling your service layer about the information or direct user initiated searches.You could have a unique id for each of your jobs instances or job runs (then id could be time + trigger) and then you could update meta info for that job run there. Quartz has job data maps but they are not meant for system integration.
Marko Lahma