ABP vNext framework Dapr EventBus module that integrated the Dapr with the ABP framework.
-
Install the following NuGet packages. (see how)
- EasyAbp.Abp.EventBus.Dapr
-
Add
DependsOn(typeof(AbpDaprEventBusModule))
attribute to configure the module dependencies. (see how) -
Configure the Dapr default pubsub name.
public override void ConfigureServices(ServiceConfigurationContext context) { var configuration = context.Services.GetConfiguration(); context.Services.Configure<DaprServiceBusOptions>(options => { options.PubSubName = "pubsub"; }); }
See the ABP distributed event bus document.
After ABP 5.0 released, the distributed event bus was redesigned. See: abpframework/abp#6126
// ABP 5.0
Task PublishAsync<TEvent>(TEvent eventData, bool onUnitOfWorkComplete = true, bool useOutbox = true);
// ABP 4.0
Task PublishAsync<TEvent>(TEvent eventData);
Before ABP 5.0, when you invoke PublishAsync, the bus will push the event to MQ at once.
As you can see, after ABP 5.0, events are sent using outbox on UOW complete by default. CAP has a built-in transactional outbox, so we can implement it easily.