From 3797ad11b3fd004484d44e0b17c5518e3352a0aa Mon Sep 17 00:00:00 2001 From: Berkan Sasmaz Date: Tue, 30 May 2023 16:50:21 +0300 Subject: [PATCH 1/7] Add `Event Tracking and Logging` section to distributed event bus document --- docs/en/Distributed-Event-Bus.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/en/Distributed-Event-Bus.md b/docs/en/Distributed-Event-Bus.md index f1b8464d59..52bfa9aa3a 100644 --- a/docs/en/Distributed-Event-Bus.md +++ b/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 From 6904694b8acd1ba6237773593385e48cd69a300e Mon Sep 17 00:00:00 2001 From: Berkan Sasmaz Date: Tue, 30 May 2023 16:57:19 +0300 Subject: [PATCH 2/7] Update Distributed-Event-Bus.md --- docs/en/Distributed-Event-Bus.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/en/Distributed-Event-Bus.md b/docs/en/Distributed-Event-Bus.md index 52bfa9aa3a..18bedcb484 100644 --- a/docs/en/Distributed-Event-Bus.md +++ b/docs/en/Distributed-Event-Bus.md @@ -191,19 +191,19 @@ It is possible to be informed when the ABP Framework **receives** or **sends** a ### 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: +The `DistributedEventReceived` local event is published when your application receives a event from the distributed 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. +- **`Source` (`DistributedEventSource`):** It represents the source of the distributed event. Source can be `Direct`, `Inbox`, `Outbox`. +- **`EventName` (`string`):** It represents the [name](#event-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: +The `DistributedEventSent` local event is published when your application sends a event to the distributed 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. +- **`Source` (`DistributedEventSource`):** It represents the source of the distributed event. Source can be `Direct`, `Inbox`, `Outbox`. +- **`EventName` (`string`):** It represents the name of the event sent. +- **`EventData` (`object`):** It represents the actual data associated with the event sent. 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. From 46bdfae3242e46a198907cdcce38ff9149c81501 Mon Sep 17 00:00:00 2001 From: Berkan Sasmaz Date: Tue, 30 May 2023 17:00:29 +0300 Subject: [PATCH 3/7] Update Distributed-Event-Bus.md --- docs/en/Distributed-Event-Bus.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/en/Distributed-Event-Bus.md b/docs/en/Distributed-Event-Bus.md index 18bedcb484..c4f100a299 100644 --- a/docs/en/Distributed-Event-Bus.md +++ b/docs/en/Distributed-Event-Bus.md @@ -193,17 +193,17 @@ It is possible to be informed when the ABP Framework **receives** or **sends** a The `DistributedEventReceived` local event is published when your application receives a event from the distributed event bus. `DistributedEventReceived` class has the following fields: -- **`Source` (`DistributedEventSource`):** It represents the source of the distributed event. Source can be `Direct`, `Inbox`, `Outbox`. -- **`EventName` (`string`):** It represents the [name](#event-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. +- **`Source`:** It represents the source of the distributed event. Source can be `Direct`, `Inbox`, `Outbox`. +- **`EventName`:** It represents the [name](#event-name) of the event received. +- **`EventData`:** It represents the actual data associated with the event received. Since it is of type `object`, it can hold any type of data. -### DistributedEventSent +### Sent events The `DistributedEventSent` local event is published when your application sends a event to the distributed event bus. `DistributedEventSent` class has the following fields: -- **`Source` (`DistributedEventSource`):** It represents the source of the distributed event. Source can be `Direct`, `Inbox`, `Outbox`. -- **`EventName` (`string`):** It represents the name of the event sent. -- **`EventData` (`object`):** It represents the actual data associated with the event sent. Since it is of type `object`, it can hold any type of data. +- **`Source`:** It represents the source of the distributed event. Source can be `Direct`, `Inbox`, `Outbox`. +- **`EventName`:** It represents the [name](#event-name) of the event sent. +- **`EventData`:** It represents the actual data associated with the event sent. 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. From 89feeaecea395983f69b00a25aa291facec44a49 Mon Sep 17 00:00:00 2001 From: Berkan Sasmaz Date: Wed, 31 May 2023 09:41:46 +0300 Subject: [PATCH 4/7] fix grammar issue on Distributed-Event-Bus document --- docs/en/Distributed-Event-Bus.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/Distributed-Event-Bus.md b/docs/en/Distributed-Event-Bus.md index c4f100a299..5544d72573 100644 --- a/docs/en/Distributed-Event-Bus.md +++ b/docs/en/Distributed-Event-Bus.md @@ -191,7 +191,7 @@ It is possible to be informed when the ABP Framework **receives** or **sends** a ### Received events -The `DistributedEventReceived` local event is published when your application receives a event from the distributed event bus. `DistributedEventReceived` class has the following fields: +The `DistributedEventReceived` local event is published when your application receives an event from the distributed event bus. `DistributedEventReceived` class has the following fields: - **`Source`:** It represents the source of the distributed event. Source can be `Direct`, `Inbox`, `Outbox`. - **`EventName`:** It represents the [name](#event-name) of the event received. @@ -199,7 +199,7 @@ The `DistributedEventReceived` local event is published when your application re ### Sent events -The `DistributedEventSent` local event is published when your application sends a event to the distributed event bus. `DistributedEventSent` class has the following fields: +The `DistributedEventSent` local event is published when your application sends an event to the distributed event bus. `DistributedEventSent` class has the following fields: - **`Source`:** It represents the source of the distributed event. Source can be `Direct`, `Inbox`, `Outbox`. - **`EventName`:** It represents the [name](#event-name) of the event sent. From 7628f9a0b689b5e74156c3a048b4f9c90e0d4a7c Mon Sep 17 00:00:00 2001 From: Berkan Sasmaz Date: Wed, 31 May 2023 15:12:24 +0300 Subject: [PATCH 5/7] Update Distributed-Event-Bus.md --- docs/en/Distributed-Event-Bus.md | 33 +++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/docs/en/Distributed-Event-Bus.md b/docs/en/Distributed-Event-Bus.md index 5544d72573..bc5e1e7346 100644 --- a/docs/en/Distributed-Event-Bus.md +++ b/docs/en/Distributed-Event-Bus.md @@ -185,11 +185,11 @@ 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 +## Monitoring Distributed Events -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. +The ABP Framework provides a powerful feature that allows you to stay informed when your application **receives** or **sends** a distributed event. This capability enables you to track the event flow within your application and take appropriate actions based on the received or sent distributed events. -### Received events +### Received Events The `DistributedEventReceived` local event is published when your application receives an event from the distributed event bus. `DistributedEventReceived` class has the following fields: @@ -197,7 +197,19 @@ The `DistributedEventReceived` local event is published when your application re - **`EventName`:** It represents the [name](#event-name) of the event received. - **`EventData`:** It represents the actual data associated with the event received. Since it is of type `object`, it can hold any type of data. -### Sent events +**Example: Get informed when your application receives an event from the distributed event bus** + +```csharp +public class DistributedEventReceivedHandler : ILocalEventHandler, ITransientDependency +{ + public async Task HandleEventAsync(DistributedEventReceived eventData) + { + // TODO: IMPLEMENT YOUR LOGIC... + } +} +``` + +### Sent Events The `DistributedEventSent` local event is published when your application sends an event to the distributed event bus. `DistributedEventSent` class has the following fields: @@ -205,8 +217,19 @@ The `DistributedEventSent` local event is published when your application sends - **`EventName`:** It represents the [name](#event-name) of the event sent. - **`EventData`:** It represents the actual data associated with the event sent. 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. +**Example: Get informed when your application sends an event to the distributed event bus ** + +```csharp +public class DistributedEventSentHandler : ILocalEventHandler, ITransientDependency +{ + public async Task HandleEventAsync(DistributedEventSent eventData) + { + // TODO: IMPLEMENT YOUR LOGIC... + } +} +``` +You can seamlessly integrate event-tracking capabilities into your application by subscribing to the `DistributedEventReceived` and `DistributedEventSent` local events as above examples. 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 From 91f4ea11d1ce2a610f1c2159c518a70f5595cff1 Mon Sep 17 00:00:00 2001 From: Berkan Sasmaz Date: Wed, 31 May 2023 15:14:59 +0300 Subject: [PATCH 6/7] Update Distributed-Event-Bus.md --- docs/en/Distributed-Event-Bus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Distributed-Event-Bus.md b/docs/en/Distributed-Event-Bus.md index bc5e1e7346..bf4cc31ab7 100644 --- a/docs/en/Distributed-Event-Bus.md +++ b/docs/en/Distributed-Event-Bus.md @@ -217,7 +217,7 @@ The `DistributedEventSent` local event is published when your application sends - **`EventName`:** It represents the [name](#event-name) of the event sent. - **`EventData`:** It represents the actual data associated with the event sent. Since it is of type `object`, it can hold any type of data. -**Example: Get informed when your application sends an event to the distributed event bus ** +**Example: Get informed when your application sends an event to the distributed event bus** ```csharp public class DistributedEventSentHandler : ILocalEventHandler, ITransientDependency From fea1e725cfef816734b851a83630832f42fa0d0f Mon Sep 17 00:00:00 2001 From: Berkan Sasmaz Date: Wed, 31 May 2023 15:24:17 +0300 Subject: [PATCH 7/7] Update Distributed-Event-Bus.md --- docs/en/Distributed-Event-Bus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Distributed-Event-Bus.md b/docs/en/Distributed-Event-Bus.md index bf4cc31ab7..550ea6d9f8 100644 --- a/docs/en/Distributed-Event-Bus.md +++ b/docs/en/Distributed-Event-Bus.md @@ -187,7 +187,7 @@ If you perform **database operations** and use the [repositories](Repositories.m ## Monitoring Distributed Events -The ABP Framework provides a powerful feature that allows you to stay informed when your application **receives** or **sends** a distributed event. This capability enables you to track the event flow within your application and take appropriate actions based on the received or sent distributed events. +The ABP Framework allows you to stay informed when your application **receives** or **sends** a distributed event. This capability enables you to track the event flow within your application and take appropriate actions based on the received or sent distributed events. ### Received Events