这是基于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.4 KiB

LINGYUN.Abp.Webhooks.ClientProxies

Webhook client proxy module that provides proxy implementation for webhook clients.

简体中文

Features

  • Webhook client proxy
  • HTTP client configuration
  • Automatic retry mechanism
  • Error handling

Module Dependencies

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

Configuration

{
  "Webhooks": {
    "ClientProxies": {
      "RetryCount": 3,  // Number of retry attempts
      "RetryInterval": "00:00:05",  // Retry interval
      "HttpTimeout": "00:00:30"  // HTTP request timeout
    }
  }
}

Basic Usage

  1. Configure Client Proxy
public override void ConfigureServices(ServiceConfigurationContext context)
{
    Configure<AbpWebhooksClientProxiesOptions>(options =>
    {
        options.RetryCount = 5;
        options.RetryInterval = TimeSpan.FromSeconds(10);
    });
}
  1. Use Client Proxy
public class YourService
{
    private readonly IWebhookClientProxy _webhookClientProxy;

    public YourService(IWebhookClientProxy webhookClientProxy)
    {
        _webhookClientProxy = webhookClientProxy;
    }

    public async Task SendWebhook()
    {
        await _webhookClientProxy.SendAsync(
            new WebhookSendArgs
            {
                WebhookUri = "https://your-webhook-endpoint",
                Data = new { /* webhook data */ }
            });
    }
}