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.1 KiB
1.1 KiB
LINGYUN.Abp.Webhooks.EventBus
Webhook event bus integration module that provides integration with the ABP event bus.
Features
- Support for publishing webhook events to the event bus
- Seamless integration with ABP event bus
- Support for distributed event bus
Module Dependencies
[DependsOn(typeof(AbpWebhooksEventBusModule))]
public class YouProjectModule : AbpModule
{
// other
}
Basic Usage
- Define Webhook Event Handler
public class YourWebhookEventHandler :
IDistributedEventHandler<WebhookEventData>,
ITransientDependency
{
public async Task HandleEventAsync(WebhookEventData eventData)
{
// Handle webhook event
}
}
- Publish Webhook Event
public class YourService
{
private readonly IDistributedEventBus _eventBus;
public YourService(IDistributedEventBus eventBus)
{
_eventBus = eventBus;
}
public async Task PublishWebhook()
{
await _eventBus.PublishAsync(new WebhookEventData
{
WebhookName = "YourWebhook",
Data = new { /* webhook data */ }
});
}
}