Configuring Hangfire SqlServer with MSMQ on windows application

Tags: #<Tag:0x00007f21e16cf048>


Starting Server
server = new BackgroundJobServer();
Queuing Job
var manager = new RecurringJobManager();
manager.AddOrUpdate(“Rec-Show-Message”,Job.FromExpression(() => ShowMessage()), Cron.Minutely());

Unable to see any queue created in MSMQ or Job getting executed. I have already configured DTC by following the link: []


Added the following code before configuration and MSMQ started working.

var queuePath = @".\Private$";
var queueName = “YourQueueName”;
if (!MessageQueue.Exists(string.Format("{0}{1}", queuePath, queueName)))
var queue = MessageQueue.Create(string.Format("{0}{1}", queuePath, queueName), true);
queue.Label = “Your Queue Description”;