I’m new to Hangfire and I have created a Blank ASP.net core project (Hangfire + SQL) and setup a recurring job that is supposed to run every hour. The job will just send a message to Rabbit MQ and Rabbit MQ will process it from there. I am trying to handle a situation where the same application is deployed in multiple server instances but the recurring job should not be triggered multiple times. The idea is that if the first server instance is down then the jobs should be executed by the second instance. But if both servers are up, the recurring jobs should not get executed twice as there is no way for Rabbit MQ to understand a duplicate message.
Please let me know if anyone has any idea regarding this. Thank You!
Hi @j.martins I’m doing well. Hope you’re fine as well. I am posting a github link for your reference. This was the final change I made to make this work in production without having duplicated recurring jobs.
If the sql server configuration is handled properly, hangfire takes care of not repeating the same job. In my case I have a recurring job that should run every 1 hour.