-
Initially I used the native implementation of Backgrounds Jobs which was working perfectly fine. Now I'd like to support clustering, therefor I followed this documentation to integrate Hangfire https://docs.abp.io/en/abp/latest/Background-Jobs-Hangfire Additionally I added However, my jobs are still being added to the native AbpBackgroundJobs table and not being picked up or registered in Hangfire. I tried removing all other AbpBackgroundJob things, but that did not make a difference. Is there an example project somewhere to compare to? I think something in the documentation is missing, but I don't know what. EDIT: When I add this line to my Module in
While having both of these defined in the Module too
It's throwing the error
If I only leave this:
The error disappears, but it still adds any jobs to the native EDIT 2: Could that be related? Why does it work for the native non-hangfire backgroundjob implementation? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think I found the problem. The native Would it be possible for Hangfire to queue a job without looking up the job, or without having the Job class registered? It doesn't really make sense for the Web project to have access to the Job class, since all it needs is the JobArg class. |
Beta Was this translation helpful? Give feedback.
Overriding the
GetQueueName
method fromHangfireBackgroundJobManager
using the code below got me 1 step further. It now enqueues the job in Hangfire (using the nativeBackgroundJobname
attribute as defined at the Job Args instead of theQueue
attribute in theJob
itself.Make sure to also replace this class in DI