dotnet-starter-kit icon indicating copy to clipboard operation
dotnet-starter-kit copied to clipboard

Hangfire extend

Open kallievz opened this issue 1 year ago • 5 comments

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

kallievz avatar Jun 15 '24 15:06 kallievz

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

iammukeshm avatar Jun 25 '24 13:06 iammukeshm

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 avatar Jun 25 '24 19:06 kallievz

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.

kallievz avatar Jun 26 '24 06:06 kallievz

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!

maxiar avatar Jun 26 '24 16:06 maxiar

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: @.***>

kallievz avatar Jun 28 '24 16:06 kallievz

Hi @kallievz

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.

Did you figure out how to integrate Elsa or any other workflow system? I really like the work @iammukeshm and the other guys have done here 👌 but I would like to extend it even further and allow users to create their own workflows in the app.

My idea is to create a new trigger for Elsa that can subscribe to events generated by the server. The user would get a drop-down with possible events and then add the activities they would like to happen when that specific event occurs for their tenant. Of course, the flows have to be tenant-specific, and possible for every user who is a member of the tenant to edit. The flows should ideally be running on an Elsa workflow server so they are possible to trigger in the background when the user is not signed in, and a new event of a certain type is generated for that tenant in the backend.

Christian-Schou avatar Nov 14 '24 08:11 Christian-Schou

Hi @kallievz @Christian-Schou, Elsa idea is really awesome. Maybe let's take it to discussion so that more people can see it. Maybe someone would be interested in creating a pull request with elsa. @iammukeshm what do you think about integrating Elsa with fullstackhero?

jacekmichalski avatar Nov 18 '24 20:11 jacekmichalski

Hi @jacekmichalski 👋

Sounds like a good idea. I will take it to a new discussion and provide some details on my thoughts 😃

Christian-Schou avatar Nov 21 '24 06:11 Christian-Schou