I am new to Hangfire and currently testing it out with a .Net6 API. I am trying to Enqueue the following method :
Hangfire.BackgroundJob.Enqueue<IDomainNotificationProcessor>(x => x.ProcessDomainEventNotificationAsync(domainEventNotification));
“ProcessDomainEventNotificationAsync” uses Mediatr to publish the “domainEventNotification” parameter. when Hangfire Server executes this job, multiple instances of the parameter which is of Type “OrderPlacedNotification” get created by a single Thread:
Until one of them is passed to the “ProcessDomainEventNotificationAsync” which handles it successfully.
When I open the dashboard and click on the “Succeeded” tab,
new instances of the parameter are created:
Whenever I re-click the succeeded tab, additional instances of the parameter keep getting created on their own without being passed to any method:
The dashboard shows that the job has been processed successfully only once.
Any help would be appreciated. Thanks!