You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2021/01/26 05:37:36 UTC

[GitHub] [james-project] chibenwa opened a new pull request #287: [ADR] JMAP PUSH over WebSockets

chibenwa opened a new pull request #287:
URL: https://github.com/apache/james-project/pull/287


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] chibenwa commented on a change in pull request #287: [ADR] JMAP PUSH over WebSockets

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #287:
URL: https://github.com/apache/james-project/pull/287#discussion_r564657032



##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,71 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newests state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that do not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.
+
+## Sequence
+
+ 1. Bob authenticates against the `ws://` endpoints. Upgrade to websockets is granted.
+ 2. Bob registers Email and Mailbox updates. A listener listens for state changes related to Bob account.
+ 3. Bob receives a mail. The MailboxManager adds it to Bob's mailbox. An `Added` event is fired on the mailbox event bus.
+ 4. The `MailboxChangeListener` processes the Added event, handles delegation, records the state change, and fires related
+ events for each account on the JMAP event bus, for both `Email` (as there is an addition) and `Mailbox` (as the counts 
+ were updated).
+ 5. Bob's webSocket listener receives a message from RabbitMQ and pushes it to Bob.
+ 6. Bob's MUA is aware it needs to re-synchronize. It will perform resynch requests combining `Email/changes`, `Email/get`,
+ `Mailbox/changes` and `Mailbox/get`.
+ 
+## Alternatives
+
+The [JMAP RFC](https://tools.ietf.org/html/rfc8620) defines [event source](https://www.w3.org/TR/eventsource/) (Server 
+Sent Events) as a supported transport medium for PUSH notification. Yet:
+
+ - Active JMAP contributors lack production experience on Event source while they do already deploy webSockets
+ - Performance enhancements (authentication and request compression) unlocked by webSockets are not achievable via event 
+ source.
+ 
+ Note that nothing refrains about future implementation of event source mechanism, that, if need be can be ignored or
+ disabled via a reverse proxy.

Review comment:
       "If someone want to implement sse no issue" is thr underlying meaning.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] rouazana commented on a change in pull request #287: [ADR] JMAP PUSH over WebSockets

Posted by GitBox <gi...@apache.org>.
rouazana commented on a change in pull request #287:
URL: https://github.com/apache/james-project/pull/287#discussion_r564433253



##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,71 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newests state changes to the client over a PUSH channel.

Review comment:
       ```suggestion
   In order to support this, we need to have the server emit newest state changes to the client over a PUSH channel.
   ```

##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,71 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newests state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that do not fit in the mailbox API.

Review comment:
       ```suggestion
   system for JMAP related events, that does not fit in the mailbox API.
   ```

##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,71 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newests state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that do not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.
+
+## Sequence
+
+ 1. Bob authenticates against the `ws://` endpoints. Upgrade to websockets is granted.

Review comment:
       Where is registrered the endpoint? Is it accessible in the session object for example?

##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,71 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newests state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that do not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.

Review comment:
       Maybe also a caveat is missing, because it means that clients will need to keep connection open with the server.
   
   Also do you think we can anticipate the fact the some proxies could break open connections after some inactivity, and so that we are able either to issue a regular keep-alive request or to restore the connection as soon as it breaks (or maybe both)?
   I don't know well the websocket protocol so maybe it's already included in the protocol.

##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,71 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newests state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that do not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.
+
+## Sequence
+
+ 1. Bob authenticates against the `ws://` endpoints. Upgrade to websockets is granted.
+ 2. Bob registers Email and Mailbox updates. A listener listens for state changes related to Bob account.
+ 3. Bob receives a mail. The MailboxManager adds it to Bob's mailbox. An `Added` event is fired on the mailbox event bus.
+ 4. The `MailboxChangeListener` processes the Added event, handles delegation, records the state change, and fires related
+ events for each account on the JMAP event bus, for both `Email` (as there is an addition) and `Mailbox` (as the counts 
+ were updated).
+ 5. Bob's webSocket listener receives a message from RabbitMQ and pushes it to Bob.
+ 6. Bob's MUA is aware it needs to re-synchronize. It will perform resynch requests combining `Email/changes`, `Email/get`,
+ `Mailbox/changes` and `Mailbox/get`.
+ 
+## Alternatives
+
+The [JMAP RFC](https://tools.ietf.org/html/rfc8620) defines [event source](https://www.w3.org/TR/eventsource/) (Server 
+Sent Events) as a supported transport medium for PUSH notification. Yet:
+
+ - Active JMAP contributors lack production experience on Event source while they do already deploy webSockets
+ - Performance enhancements (authentication and request compression) unlocked by webSockets are not achievable via event 
+ source.
+ 
+ Note that nothing refrains about future implementation of event source mechanism, that, if need be can be ignored or
+ disabled via a reverse proxy.

Review comment:
       sorry I don't understand this sentence and it seems to be about 2 different topics




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] chibenwa closed pull request #287: [ADR] JMAP PUSH over WebSockets

Posted by GitBox <gi...@apache.org>.
chibenwa closed pull request #287:
URL: https://github.com/apache/james-project/pull/287


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] remk commented on a change in pull request #287: [ADR] JMAP PUSH over WebSockets

Posted by GitBox <gi...@apache.org>.
remk commented on a change in pull request #287:
URL: https://github.com/apache/james-project/pull/287#discussion_r565377616



##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,70 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newest state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that does not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.
+
+## Sequence
+
+ 1. Bob authenticates against the `ws://` endpoints. Upgrade to websockets is granted.
+ 2. Bob registers Email and Mailbox updates. A listener listens for state changes related to Bob account.
+ 3. Bob receives a mail. The MailboxManager adds it to Bob's mailbox. An `Added` event is fired on the mailbox event bus.
+ 4. The `MailboxChangeListener` processes the Added event, handles delegation, records the state change, and fires related
+ events for each account on the JMAP event bus, for both `Email` (as there is an addition) and `Mailbox` (as the counts 
+ were updated).
+ 5. Bob's webSocket listener receives a message from RabbitMQ and pushes it to Bob.

Review comment:
       
   In a setup with multiple james, how do we make sure the listener is running on the node where the ws connection is open ? 
   Should their be one listener per open connection ? 

##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,70 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newest state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that does not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.
+
+## Sequence
+
+ 1. Bob authenticates against the `ws://` endpoints. Upgrade to websockets is granted.
+ 2. Bob registers Email and Mailbox updates. A listener listens for state changes related to Bob account.

Review comment:
       It is maybe not related to this particular ADR but i would like some explanation on the lifecycle of those listeners. When are they created/destroyed ?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] Arsnael commented on a change in pull request #287: [ADR] JMAP PUSH over WebSockets

Posted by GitBox <gi...@apache.org>.
Arsnael commented on a change in pull request #287:
URL: https://github.com/apache/james-project/pull/287#discussion_r564286993



##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,71 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newests state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that do not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.
+
+## Sequence
+
+ 1. Bob authenticates against the `ws://` endpoints. Upgrade to websockets is granted.
+ 2. Bob registers Email and Mailbox updates. A listener listen for state changes related to Bob account.
+ 3. Bob receives a mail. The MailboxManager adds it to bob mailbox. An `Added` event is fired on the mailbox event bus.
+ 4. The `MailboxChangeListener` process the Added event, handles delegation, record the state change, and fires related

Review comment:
       s/process/processes
   s/record/records

##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,71 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newests state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that do not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.
+
+## Sequence
+
+ 1. Bob authenticates against the `ws://` endpoints. Upgrade to websockets is granted.
+ 2. Bob registers Email and Mailbox updates. A listener listen for state changes related to Bob account.
+ 3. Bob receives a mail. The MailboxManager adds it to bob mailbox. An `Added` event is fired on the mailbox event bus.

Review comment:
       s/bob/Bob's

##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,71 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newests state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that do not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.
+
+## Sequence
+
+ 1. Bob authenticates against the `ws://` endpoints. Upgrade to websockets is granted.
+ 2. Bob registers Email and Mailbox updates. A listener listen for state changes related to Bob account.

Review comment:
       s/listen/listens

##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,71 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newests state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that do not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.
+
+## Sequence
+
+ 1. Bob authenticates against the `ws://` endpoints. Upgrade to websockets is granted.
+ 2. Bob registers Email and Mailbox updates. A listener listen for state changes related to Bob account.
+ 3. Bob receives a mail. The MailboxManager adds it to bob mailbox. An `Added` event is fired on the mailbox event bus.
+ 4. The `MailboxChangeListener` process the Added event, handles delegation, record the state change, and fires related
+ events for each account on the JMAP event bus, for both `Email` (as there is an addition) and `Mailbox` (as the counts 
+ were updated).
+ 5. Bob's webSocket listener receives a message from RabbitMQ and pushes it to bob.

Review comment:
       s/bob/Bob




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] chibenwa commented on a change in pull request #287: [ADR] JMAP PUSH over WebSockets

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #287:
URL: https://github.com/apache/james-project/pull/287#discussion_r565380881



##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,70 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newest state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that does not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.
+
+## Sequence
+
+ 1. Bob authenticates against the `ws://` endpoints. Upgrade to websockets is granted.
+ 2. Bob registers Email and Mailbox updates. A listener listens for state changes related to Bob account.
+ 3. Bob receives a mail. The MailboxManager adds it to Bob's mailbox. An `Added` event is fired on the mailbox event bus.
+ 4. The `MailboxChangeListener` processes the Added event, handles delegation, records the state change, and fires related
+ events for each account on the JMAP event bus, for both `Email` (as there is an addition) and `Mailbox` (as the counts 
+ were updated).
+ 5. Bob's webSocket listener receives a message from RabbitMQ and pushes it to Bob.

Review comment:
       > Should their be one listener per open connection ?
   
   Yes. Event-Bus ADR do document how specific events gets routed to the right listener.
   
   >  how do we make sure the listener is running on the node where the ws connection is open ?
   
   In short: using the registered listeners, just like IMAP IDLE and SelectedMailbox.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] chibenwa commented on pull request #287: [ADR] JMAP PUSH over WebSockets

Posted by GitBox <gi...@apache.org>.
chibenwa commented on pull request #287:
URL: https://github.com/apache/james-project/pull/287#issuecomment-769561540


   Merged


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] chibenwa commented on a change in pull request #287: [ADR] JMAP PUSH over WebSockets

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #287:
URL: https://github.com/apache/james-project/pull/287#discussion_r565381523



##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,70 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newest state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that does not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.
+
+## Sequence
+
+ 1. Bob authenticates against the `ws://` endpoints. Upgrade to websockets is granted.
+ 2. Bob registers Email and Mailbox updates. A listener listens for state changes related to Bob account.

Review comment:
       It likely is.
   
   Created upon the client requests PUSH, deleted when the client cancels the PUSH request or disconnects.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] chibenwa commented on a change in pull request #287: [ADR] JMAP PUSH over WebSockets

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #287:
URL: https://github.com/apache/james-project/pull/287#discussion_r564655747



##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,71 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newests state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that do not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.

Review comment:
       There is a ping/pong mechanism to keep the connection alive.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] chibenwa commented on a change in pull request #287: [ADR] JMAP PUSH over WebSockets

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #287:
URL: https://github.com/apache/james-project/pull/287#discussion_r564656217



##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -0,0 +1,71 @@
+# 47. JMAP PUSH over WebSockets
+
+Date: 2021-01-26
+
+## Status
+
+Accepted (lazy consensus).
+
+Relates to [45. Support JMAP Push with Mailbox/changes implementation](0045-support-jmap-push-with-mailbox-changes-implementation.md)
+
+Requires [46. Generalize EventBus](0046-generalize-event-bus.md)
+
+## Context
+
+JMAP Push notifications allow clients to efficiently update (almost) instantly to stay in sync with data changes on the server. 
+
+In order to support this, we need to have the server emit newests state changes to the client over a PUSH channel.
+
+## Decision
+
+We will implement [RFC-8887 - A JSON Meta Application Protocol (JMAP) Subprotocol for WebSocket](https://tools.ietf.org/html/rfc8887) 
+as a transport mechanism for PUSH notifications.
+
+We will [generalize EventBus](0046-generalize-event-bus.md) in order to achieve an out-of-the box Publish-Subscribe 
+system for JMAP related events, that do not fit in the mailbox API.
+
+We will implement listeners registered on the JMAP event bus for WebSocket clients in order to carry over state changes
+to the client.
+
+## Consequences
+
+We expect clients using the PUSH to lead to a drastic performance enhancement, as less data needs to be transmitted upon
+resynchronisation.
+
+As mentioned in RFC-8887 the usage of webSockets allows other performance optimizations:
+ - Requests can easily be compressed, which is not doable over HTTP for most available implementation (HTTP request 
+compression is not ubiquitous).
+ - WebSockets being connected, authentication can be performed once, when establishing the connection. This can allow to
+reduce the load, if needed, on authentication systems. It might ease the use for instance of custom OpenId connect 
+providers.
+
+People deploying JMAP need to be aware that load-balancing webSockets requires session stickiness.
+
+## Sequence
+
+ 1. Bob authenticates against the `ws://` endpoints. Upgrade to websockets is granted.

Review comment:
       Yes according to rfc-8887.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [james-project] remk commented on a change in pull request #287: [ADR] JMAP PUSH over WebSockets

Posted by GitBox <gi...@apache.org>.
remk commented on a change in pull request #287:
URL: https://github.com/apache/james-project/pull/287#discussion_r565888921



##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -53,6 +53,13 @@ People deploying JMAP need to be aware that load-balancing webSockets requires s
  6. Bob's MUA is aware it needs to re-synchronize. It will perform resynch requests combining `Email/changes`, `Email/get`,
  `Mailbox/changes` and `Mailbox/get`.
  
+Event bus listener are created for each socket upon client requests, and removed upon disconnection or when PUSH is
+explicitly canceled by the client.
+
+In a multi-node settup, the event bus registration key mechanism described in [this ADR](0037-eventbus.md) and its 
+[distributed implementation](0038-distributed-eventbus.md) ensures events are routed to

Review comment:
       s/ensures/ensure

##########
File path: src/adr/0047-jmap-push-over-websockets.md
##########
@@ -53,6 +53,13 @@ People deploying JMAP need to be aware that load-balancing webSockets requires s
  6. Bob's MUA is aware it needs to re-synchronize. It will perform resynch requests combining `Email/changes`, `Email/get`,
  `Mailbox/changes` and `Mailbox/get`.
  
+Event bus listener are created for each socket upon client requests, and removed upon disconnection or when PUSH is
+explicitly canceled by the client.
+
+In a multi-node settup, the event bus registration key mechanism described in [this ADR](0037-eventbus.md) and its 

Review comment:
       s/settup/setup




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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