Browse Source

Add `Event Tracking and Logging` section to distributed event bus document

pull/16709/head
Berkan Sasmaz 3 years ago
parent
commit
3797ad11b3
No known key found for this signature in database GPG Key ID: 4E387A3A3BCC339B
  1. 22
      docs/en/Distributed-Event-Bus.md

22
docs/en/Distributed-Event-Bus.md

@ -185,6 +185,28 @@ If you perform **database operations** and use the [repositories](Repositories.m
> The handler class must be registered to the dependency injection (DI). The sample above uses the `ITransientDependency` to accomplish it. See the [DI document](Dependency-Injection.md) for more options.
## Event Tracking and Logging
It is possible to be informed when the ABP Framework **receives** or **sends** a distributed event. The framework automatically **logs** all distributed events to the standard [logger](https://docs.abp.io/en/abp/latest/Logging), but you may require additional functionality.
### Received events
The `DistributedEventReceived` local event is published when your application receives a distributed event from the event bus. `DistributedEventReceived` class has the following fields:
- **`Source` (`DistributedEventSource`):** It represents the source of the distributed event.. Source can be `Inbox`, `Outbox`, `Direct`.
- **`EventName` (`string`):** It represents the name of the event received.
- **`EventData` (`object`):** It represents the actual data associated with the event received. Since it is of type `object`, it can hold any type of data.
### DistributedEventSent
The `DistributedEventSent` local event is published when your application sends a distributed event to the event bus. `DistributedEventSent` class has the following fields:
- **`Source` (`DistributedEventSource`):** It represents the source of the distributed event.. Source can be `Inbox`, `Outbox`, `Direct`.
- **`EventName` (`string`):** It represents the name of the event received.
- **`EventData` (`object`):** It represents the actual data associated with the event received. Since it is of type `object`, it can hold any type of data.
You can seamlessly integrate event-tracking capabilities into your application by subscribing the `DistributedEventReceived` and `DistributedEventSent` local events. This empowers you to effectively monitor the messaging flow, diagnose any potential issues, and gain valuable insights into the behavior of your distributed messaging system.
## Pre-Defined Events

Loading…
Cancel
Save