You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Updates as per PR comments.
* Story #607 - Update to the README.md. Created the onboarding.md.
* Included Architecture and Technologies Overview as requested in the review.
* Included new images.
* Changed images to png since svg is not displaying correctly.
* Updated with additional suggestions as per review.
The Central Event Processor (CEP) service provides the capability to monitor for a pre-defined/configured set of business rules or patterns such as breaching the threshold set for a particular limit (or Net Debit Cap) or a Position Adjustment based on a Settlement.
8
+
9
+
In the current iteration, the rules are set to monitor for three criteria:
10
+
11
+
1. Breaching of a threshold on the Limit of Net Debit Cap (which may be set as part of on-boarding)
12
+
2. Adjustment of the limit - Net Debit Cap
13
+
3. Adjust of position based on a Settlement.
14
+
15
+
The CEP can then be integrated with a notifier service, to send out notifications or alerts. In this instance, it integrates with the email-notifier to send out alerts based on the aforementioned criteria.
2
16
3
17
## Contents
4
-
<!-- vscode-markdown-toc -->
5
-
*1.[Stories](#Stories)
6
-
*2.[Tasks](#Tasks)
7
-
*3.[Reacts on](#Reactson)
8
-
*4.[Used technologies](#Usedtechnologies)
9
-
*5.[Local storage](#Localstorage)
10
-
*6.[Architecture overview](#Architectureoverview)
11
-
*7.[General process overview](#Generalprocessoverview)
This is standalone service which is connected to Kafka Notification topic into the mojaloop environemnt and monitors the topic for messages which match certain rules and takes actions accordingly.
62
71
63
-
The service is developed using [RxJS](https://github.com/ReactiveX/rxjs) for observing the system and acting accordingly. The decissions for actions are taken by the [json-rule-engine](https://github.com/cachecontrol/json-rules-engine).
72
+
The service is developed using [RxJS](https://github.com/ReactiveX/rxjs) for observing the system and acting accordingly. The decisions for actions are taken by the [json-rule-engine](https://github.com/cachecontrol/json-rules-engine).
[Architecture and Technologies Overview](docs/architechDiagrams/CEPArchTechOverview.svg)
79
+
80
+
## 9. General process overview
64
81
65
-
## 7. <aname='Generalprocessoverview'></a>General process overview
66
82

67
83
84
+
[Process Overview](docs/images/2.png)
85
+
68
86
The rules validations are triggered upon commited transfers. As soon as a commited transfer notification is produced from the central-ledger to the notification topic, the central-notifications service picks it up, gathers more information, runs few rules validations and acts based on rules engine outcome.
69
87
70
88
The data for performing rules validation is requested from the central-ledger admin API calls using observables, available [here](src/observables/centralLedgerAPI.js) some mapping and wiring is done through below [enums](src/lib/enum.js) properties:
2.[Limit Position Threshold Breach Rule](src/observables/rules/ndcBreach.js)
120
+
102
121
In the current implementation for each separate rule, an observable has to be created, like the couple above, and configured when and how to trigger it into the [setup](src/setup.js)
103
122
The Rules outputs should be chained to common Action Agent.
104
123
105
-
### 7.3. <aname='Config'></a>Config
124
+
### 9.3. Config
125
+
126
+
The default [config](config/config.json)
106
127
107
-
The default config is available [here](config/config.json)
108
128
To use Environmental Variables for MongoDB URI and database name use:
The Action Agent - [here](src/observables/actions) - takes care of action preparation regrding the data from central-ledger admin API and various settings.
The scheduler coordinates the Action Object that requires to be dispatched. It would typically action a scheduled event that qualifies by insure only the prescribed number of notifications are dispatched within the set time frame defined.
Email notifier service is a separate app, that observes the same topic for messages with field *from* = `SYSTEM`. Its code is available [here](https://github.com/mojaloop/email-notifier)
168
+
[Notifier flow](docs/images/6.png)
169
+
170
+
Email notifier service is a separate app, that observes the same topic for messages with field *from* = `SYSTEM`. Its code is available in the [email-notifier](https://github.com/mojaloop/email-notifier) repository.
0 commit comments