chibenwa commented on code in PR #2884:
URL: https://github.com/apache/james-project/pull/2884#discussion_r2613700074


##########
src/adr/0073-dedicated-eventbus-for-message-content-deletion.md:
##########
@@ -0,0 +1,44 @@
+# 73. Relying on EventBus for message deletion side effects
+
+Date: 2025-12-12
+
+## Status
+
+Accepted (lazy consensus) & implemented.
+
+## Context
+

Review Comment:
   A good hold friend told me we shall start ADRs specking of email. And that 
too technical ADRs shall be linked to functional concepts.
   
   Let me try it:
   
   ```
   We want to perform actions upon email deletion, for instance copying events 
in the [Deleted Message Vault](TO BE WRITTEN) or clearing the corresponding 
message preview (used to serve an optimized data projection over the JMAP 
protocol).
   
   Deletion action can be long (content copy) and are thus in Cassandra and 
Postgress done asynchronously in the 
[DeleteMessageListener](https://github.com/apache/james-project/blob/master/src/adr/0029-Cassandra-mailbox-deletion-cleanup.md).
   
   We encountered issues, most notably with mailbox deletion, wich triggered 
those operation on a message set of message, leading to event processing 
stalling and eventually timeout.
   
   This had been historically solved in the Distributed server by adding a 
custom RabbitMQ queue for the deleted message vauklt to sequence and distribute 
each single deletions. While it lead to a viable use in production, this 
approach suffers from the following pitfall:
   
    - It duplicates the Event bus code, used for work queues
    - It requires a lot of custom code for adoption in other implementations
    - It makes it hard to add other "features" in a composablee fashion without 
duplicating a lot of code
   ```
   
   And while we are at it we could retrospectively write an ADR on the Deleted 
Message Vault (separated issue?)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to