aspnetboilerplate: Notification publisher is not working with HangFire?
Using ABP 10.0
Hi,
When I use following publish code:
_notiticationPublisher.PublishAsync("System.AdminMessage", data, severity: severity, tenantIds: new int?[] {tenantId}));
It’s doesnt save anything to database.
Can be that I am using HangFire default IBackgroundJobManager
?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (8 by maintainers)
Hi,
Can you try with disabling backgroundJobs with this line in PreInitialize of your web module ?
Configuration.BackgroundJobs.IsJobExecutionEnabled = false;
Then try to publish notification with:
_notiticationPublisher.PublishAsync("System.AdminMessage", data, severity: severity, tenantIds: new int?[] {tenantId}));
If NotificationInfo is saved to database, then probably NotificationDistributer is deleting NotificationInfo records from AbpNotifications table when Configuration.BackgroundJobs.IsJobExecutionEnabled = true;. This is the expected behaviour actually.
https://github.com/aspnetboilerplate/aspnetboilerplate/blob/763e718341a42ef1799d9ded5fae228f652d7a6b/src/Abp/Notifications/NotificationDistributer.cs#L52