You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by rc...@apache.org on 2021/01/22 07:36:00 UTC

[james-project] branch master updated: JAMES-3211 Extends mailbox-api EventBus interface ADR

This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e431c3  JAMES-3211 Extends mailbox-api EventBus interface ADR
4e431c3 is described below

commit 4e431c346822a672350ee412a53e6e7e44590913
Author: LanKhuat <kh...@gmail.com>
AuthorDate: Thu Jun 11 14:24:46 2020 +0700

    JAMES-3211 Extends mailbox-api EventBus interface ADR
---
 src/adr/0046-generalize-event-bus.md | 38 ++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/src/adr/0046-generalize-event-bus.md b/src/adr/0046-generalize-event-bus.md
new file mode 100644
index 0000000..4473f9f
--- /dev/null
+++ b/src/adr/0046-generalize-event-bus.md
@@ -0,0 +1,38 @@
+#46. Generalize EventBus
+
+Date: 2020-06-11
+
+## Status
+
+Proposed
+
+## Context
+
+User email storage usage is limited both in size and count via quotas (IMAP RFC-2087). In order to ease administrating large user bases, the quota search extension allows administrator
+to retrieve all users whose email usages are exceeding a given occupation ratio.
+
+When searching for users by quota ratio if we set the value of the parameters to 0, for example: `/quotas/users?minOccupationRatio=0&maxOccupationRatio=0`, the search feature is supposed to return newly created users
+who have not received any email yet at that point. However, this is not the case because the quotas are currently being initialized only after
+a user has received the first email.
+
+We need to initialize user quotas upon user creation time. The problem is: there is currently no event at user creation 
+and since the quota-search feature is a plugin of James, it cannot be hardwired into the domain logic of user management to initialize the quota for a just created user.
+
+## Decision
+
+For quota-search to be initialized/removed for a given user while keeping this feature as a plugin, we decided to adopt the Event Driven pattern we already use in Mailbox-api. 
+We can create new events related to user management (UserCreated, UserRemoved and so on).
+
+To achieve that, we will extract the EventBus out of mailbox-api in order to make it a utility component (eventbus-api), then we will make both mailbox-api and data-api depend on that new module. 
+
+## Consequences
+
+Mailbox-api would leverage the EventBus to keep exposing the mailbox-listener-api without changes on top of the generified EventBus. We need to define a common Event interface in eventbus-api, 
+then each EventBus usage will define its own sealed event hierarchy implementing Event.
+
+DeadLetter storage needs to be reworked in order to store events of various EventBus separately (which is needed for knowing which EventBus the event should be reprocessed on 
+and knowing which sealed hierarchy an event belongs to.)
+
+As a consequence, we will need a Cassandra data migration to add the EventBus name as part of the EventDeadLetter primary key. 
+
+We could rely on the EventBus reliability for building any feature in James.
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org