Trying to understand if I can do this in Hangfire.
I have an ASP.NET WEB API application. The application takes requests from users to print labels on Zebra printers that exist on our internal network.
It’s working okay right now, but when the user wants to print a large number of labels with a single request it can take some time which holds up the API.
What I want to do is get the request from the user, send back a 200 OK and put the label into a queue to be printed.
A couple of caveats.
- I need the labels to print in order that they were requested.
- If a label is printing to printer 127.0.0.5, we can not send more labels there until that job is done.
- If a label is requested to printer 127.0.0.6 then it can print right away.
My thought was to have a queue for each printer and process them in the order received.
Is this something that I can do with Hangfire? What challenges can I expect?
What if the print job fails, can I put it back in the queue? What if it fails multiple times, can I then cancel it so it doesn’t try to print again?