fullstackhero / dotnet-starter-kit

Production Grade Cloud-Ready .NET 8 Starter Kit (Web API + Blazor Client) with Multitenancy Support, and Clean/Modular Architecture that saves roughly 200+ Development Hours! All Batteries Included.
https://fullstackhero.net/dotnet-webapi-boilerplate/
MIT License
5.04k stars 1.5k forks source link

Hangfire extend #944

Closed kallievz closed 2 months ago

kallievz commented 2 months ago

Add queue for email Add method extension to use specific queue. Add sample on user register using queue email

iammukeshm commented 2 months ago

So this creates a separate queue for email jobs? @kallievz

kallievz commented 2 months ago

Correct, i only updated one of the email jobs as sample how to use. So one will go in email queue, the other in default queue.

Get Outlook for iOShttps://aka.ms/o0ukef


From: Mukesh Murugan @.> Sent: Tuesday, June 25, 2024 3:20:39 PM To: fullstackhero/dotnet-starter-kit @.> Cc: Kallie @.>; Mention @.> Subject: Re: [fullstackhero/dotnet-starter-kit] Hangfire extend (PR #944)

So this creates a separate queue for email jobs? @kallievzhttps://github.com/kallievz

— Reply to this email directly, view it on GitHubhttps://github.com/fullstackhero/dotnet-starter-kit/pull/944#issuecomment-2188948145, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXYXSFYO3FMKQVVJFFCC2KDZJFVCPAVCNFSM6AAAAABJLYI5U6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBYHE2DQMJUGU. You are receiving this because you were mentioned.Message ID: @.***>

kallievz commented 2 months ago

Sorry, was AFK.

You can create multiple queues in Hangfire startup. Priority is community version is alphabetic in nature, thus Default will take preference over email queue. This can be used to trigger tasks that is not priority. Based on priority, highest will be processed first, and then lower priority. if all is low priority, and a higher priority task is triggered, task will be assigned to the next available broker to process, and then continue with the lower priority queue again. We using it like that in our production system for importing/exporting and background scheduled jobs.

maxiar commented 2 months ago

Hi @kallievz / @iammukeshm .... About Hangfire, What are yours opinion about HangfireMediator pattern to integrate with MediaR, please check this comment: https://github.com/fullstackhero/dotnet-starter-kit/discussions/907#discussioncomment-9739543 and this: https://codeopinion.com/using-hangfire-and-mediatr-as-a-message-dispatcher/

Regards!

kallievz commented 2 months ago

Looks great, could work for larger systems with lot of moving parts. I would definately be able to use in this way. I am currently using hangfire for managing email sending events for our clients. Would like to extend a bit more. I am foreseeing using Elsa, hangfire and Masstransit in union for our system, still figuring out the microservice part how it flows together, but getting there.

Get Outlook for iOShttps://aka.ms/o0ukef


From: maxiar @.> Sent: Wednesday, June 26, 2024 6:39:39 PM To: fullstackhero/dotnet-starter-kit @.> Cc: Kallie @.>; Mention @.> Subject: Re: [fullstackhero/dotnet-starter-kit] Hangfire extend (PR #944)

Hi @kallievzhttps://github.com/kallievz / @iammukeshmhttps://github.com/iammukeshm .... About Hangfire, What are yours opinion about HangfireMediator pattern to integrate with MediaR, please check this comment:

907 (comment)https://github.com/fullstackhero/dotnet-starter-kit/discussions/907#discussioncomment-9739543

and this: https://codeopinion.com/using-hangfire-and-mediatr-as-a-message-dispatcher/

Regards!

— Reply to this email directly, view it on GitHubhttps://github.com/fullstackhero/dotnet-starter-kit/pull/944#issuecomment-2192174632, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXYXSFYTMOO4GK6AC4FDT33ZJLVEXAVCNFSM6AAAAABJLYI5U6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSGE3TINRTGI. You are receiving this because you were mentioned.Message ID: @.***>