Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update hangfire.md #22192

Open
wants to merge 1 commit into
base: rel-8.3
Choose a base branch
from
Open

Update hangfire.md #22192

wants to merge 1 commit into from

Conversation

omer-repo
Copy link
Contributor

docs: Add queue configuration options for Hangfire in ABP documentation

  • Added instructions for specifying queue names using AddHangfireServer method.
  • Added instructions for specifying queue names using AbpHangfireOptions.
  • Included examples for both configurations in the ConfigureServices method.

Description

This pull request adds documentation for specifying the queue name for Hangfire jobs in ABP. It includes two methods for setting the queue:

Using AddHangfireServer method.
Using AbpHangfireOptions.
The documentation provides examples for both configurations and explains how to integrate them into the ConfigureServices method.

Checklist

  • [ X] I fully tested it as developer / designer
  • and created unit / integration tests
  • [ X] I documented it (or no need to document or I will create a separate documentation issue)

docs: Add queue configuration options for Hangfire in ABP documentation

- Added instructions for specifying queue names using AddHangfireServer method.
- Added instructions for specifying queue names using AbpHangfireOptions.
- Included examples for both configurations in the ConfigureServices method.
@CLAassistant
Copy link

CLAassistant commented Feb 19, 2025

CLA assistant check
All committers have signed the CLA.

```csharp
context.Services.AddHangfireServer(options =>
{
options.Queues = new[] { "alpha" };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

ABP does not support the method because ABP internally creates a HangfireServer.
https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.HangFire/Volo/Abp/Hangfire/AbpHangfireOptions.cs#L35

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, actually I guessed it already creates a HangifireServer but it worked also.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI, after test, it not work. you can try use the demo app https://github.com/omer-repo/abp/tree/patch-2/modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.RabbitMq
to configure the AddHangfireServer method:

You will find that it is still consuming the default queue

context.Services.AddHangfireServer(options =>
{
    options.Queues = new[] { "alpha" };
});

@realLiangshiwei realLiangshiwei self-requested a review February 21, 2025 13:51
Copy link
Member

@realLiangshiwei realLiangshiwei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants