You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.7 KiB
1.7 KiB
LINGYUN.Abp.WebhooksManagement.Domain
Webhook management domain module that provides webhook storage and management functionality.
Features
- Support for storing static webhooks in database
- Support for dynamic webhook storage
- Webhook cache management
- Timestamp expiration mechanism
Module Dependencies
[DependsOn(typeof(AbpWebhooksManagementDomainModule))]
public class YouProjectModule : AbpModule
{
// other
}
Configuration
{
"WebhooksManagement": {
"SaveStaticWebhooksToDatabase": true, // Whether to save static webhooks to database, default true
"IsDynamicWebhookStoreEnabled": false, // Whether to enable dynamic webhook storage, default false
"WebhooksCacheRefreshInterval": "00:00:30", // Cache refresh interval, default 30 seconds
"WebhooksCacheStampTimeOut": "00:02:00", // Timestamp request timeout, default 2 minutes
"WebhooksCacheStampExpiration": "00:30:00" // Timestamp expiration time, default 30 minutes
}
}
Basic Usage
- Configure Webhook Management Options
Configure<WebhooksManagementOptions>(options =>
{
options.SaveStaticWebhooksToDatabase = true;
options.IsDynamicWebhookStoreEnabled = true;
options.WebhooksCacheRefreshInterval = TimeSpan.FromMinutes(1);
});
- Using Webhook Storage
public class YourService
{
private readonly IWebhookDefinitionManager _webhookDefinitionManager;
public YourService(IWebhookDefinitionManager webhookDefinitionManager)
{
_webhookDefinitionManager = webhookDefinitionManager;
}
public async Task DoSomething()
{
var webhooks = await _webhookDefinitionManager.GetAllAsync();
// Process webhooks
}
}