Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I've started a project to generate reports for our system. These are reports that we deliver to our end customers and they are so specialized that no existing system can generate them. This is not the problem however, the generator is working just fine.

For simpleness I've based it on an ASP.NET-solution that generates HTML that I squeeze through phantomjs to generate PDFs of the result. This also works fine. However, this is a one-shot operation. Right now I have a .BAT-file that runs phantomjs with a specific url, and this generates my PDF. However, I need to make some kind of queue-system, so the generation of reports is automatic when they are ordered.

The ordering-system is part of a legacy-system that is scheduled to be renewed, but "Not Right Now"(TM). So right now the orders are put in an SQL-table, with a "status"-column saying if it's generated or not. What I'm looking for are ideas for a system to run these reports, and maybe in the future even easily switch for a "real" queue based system (RabbitMQ or such).

I'm not locked to any language/framework as long as it's stable on windows, and can communicate with SQL Server. (I know C# and JS best). I was thinking of just making it with C#, but I'm not quite sure about the robustness of shelling out to phantomjs.. (I'm not sure about the robustness of shelling out to anything as a critical business operation ;) )

share|improve this question
but I'm not quite sure about the robustness of shelling out to phantomjs -- Do you have any other choices? – Robert Harvey Feb 10 '14 at 16:42
Probably not. And I can't really explain why I don't feel comfortable with shelling out. Something about loosing control I guess. Maybe I need to read up more on the whole process of process-control and errormessages and such. – Christian Wattengård Feb 10 '14 at 16:50

Right now I have a .BAT-file that runs phantomjs with a specific url

Well, if that is your concern, why not avoid this batch file and run "phantomjs" through Process.Start? The robustness of such a solution will mainly depend on the correct error handling you implement (probably including time out handling etc.), and the way how you avoid file collisions when your queuing system starts running several pdf creation processes in parallel (make sure you use unique file names).

Furthermore, its perfectly possible to use the command shell for critical operations, but you have to implement full error handling there as well, which is somewhat harder than using languages like C# or VB.NET.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.