这是基于vue-vben-admin 模板适用于abp Vnext的前端管理项目
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.9 KiB

LINGYUN.Abp.Webhooks.Core

Core webhook module that provides webhook definition, configuration and basic functionality support.

简体中文

Features

  • Webhook definition management
  • Configurable webhook timeout and retry mechanism
  • Automatic subscription deactivation protection
  • Customizable HTTP headers
  • Support for multiple webhook providers

Module Dependencies

[DependsOn(typeof(AbpWebhooksCoreModule))]
public class YouProjectModule : AbpModule
{
  // other
}

Configuration

{
  "Webhooks": {
    "TimeoutDuration": "00:01:00",  // Default timeout duration, 60 seconds by default
    "MaxSendAttemptCount": 5,  // Maximum number of send attempts
    "IsAutomaticSubscriptionDeactivationEnabled": true,  // Whether to automatically deactivate subscription when reaching maximum consecutive failures
    "MaxConsecutiveFailCountBeforeDeactivateSubscription": 15,  // Maximum consecutive failures before subscription deactivation, default is MaxSendAttemptCount * 3
    "DefaultAgentIdentifier": "Abp-Webhooks",  // Default sender identifier
    "DefaultHttpHeaders": {  // Default HTTP headers
      "_AbpDontWrapResult": "true",
      "X-Requested-From": "abp-webhooks"
    }
  }
}

Basic Usage

  1. Define a Webhook
public class YourWebhookDefinitionProvider : WebhookDefinitionProvider
{
    public override void Define(IWebhookDefinitionContext context)
    {
        context.Add(
            new WebhookDefinition(
                name: "TestWebhook",
                displayName: L("DisplayName:TestWebhook"),
                description: L("Description:TestWebhook")
            )
        );
    }
}
  1. Configure Webhook Options
Configure<AbpWebhooksOptions>(options =>
{
    options.TimeoutDuration = TimeSpan.FromMinutes(2);
    options.MaxSendAttemptCount = 3;
    options.AddHeader("Custom-Header", "Value");
});