Notification publisher is not working with HangFire?
See original GitHub issueUsing 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
?
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Hangfire doesnt work anymore after publishing the project
I'm working with ASP.NET MVC 5. .NET Framework has the version 4.5. After I published my Project, Hangfire doesnt work anymore. So my...
Read more >Significant memory leak on production server - .NET, IIS ...
We use Hangfire service for scheduling some operations like sending notifications or reloading some data. Each of them occurs single time or ...
Read more >Hangfire with ASP.NET Core
Hangfire is an open-source task scheduler for ASP.NET and ASP.NET Core. It's simple to integrate, multi-threaded and easily scalable.
Read more >Background Tasks and Scheduled Jobs in .NET? Meet ...
Do you often find yourself grappling with managing background tasks and scheduled jobs in your .NET or C# applications?
Read more >Implementing the Outbox Pattern Using Hangfire and ...
Implementing the outbox pattern with CQRS-Style request/notification handler decorators on top of Hangfire is a nice and easy solution for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
Thanks. I will create Feature Request for keep history of sent notifications.