HTTP PubSub Proposals Comparison

 

Hi Folks, (apologies for the HTML email)

I've put together a comparison of the different HTTP pub/sub proposals.
I've focused on 4 categories.  These are likely discussion points for the
group, should we take on the mission of converging on a standard for PubSub.
We can do it!

By adding new semantic features, which web devs and end users desire, we may
also create pull that helps drive upgrades to middleboxes interfering with
h2/h3.

What do people think? 


Categories


Subscription Setup

The methods use to set up a subscription


Event Channel

How events are delivered to the subscriber


Event Payload

What the content of the events are.


Discovery

Discovery of PubSub features

 

After the comparison, I've included examples from the relevant
specifications.


The proposals


Mark Nottingham's aka MNOT https://www.mnot.net/blog/2022/02/20/websockets

Braid aka BRAID
https://datatracker.ietf.org/doc/html/draft-toomim-httpbis-braid-http

Braid Multiresponse idea:
https://datatracker.ietf.org/doc/html/draft-toomim-httpbis-versions#section-
2.4.4

Rahul Gupta's aka PREP
https://www.ietf.org/archive/id/draft-gupta-httpbis-per-resource-events-01.h
tml

GENA  <https://datatracker.ietf.org/doc/html/draft-cohen-gena-p-base-01>
https://datatracker.ietf.org/doc/html/draft-cohen-gena-p-base-01 and

 <https://datatracker.ietf.org/doc/html/draft-cohen-gena-client-00>
https://datatracker.ietf.org/doc/html/draft-cohen-gena-client-00

 


Subscription Setup


MNOT uses a new method SUB 

BRAID uses GET with a Subscribe: HTTP header

PREP uses GET with an Accept-Events: HTTP header

GENA uses new method SUBSCRIBE

 


Event channel


MNOT uses return path, with 1xx PUB response codes

BRAID uses return path with a 209 Subscription response code

BRAID Multiresponse uses a return path with a 209 Multiresponse code

PREP uses return path with multipart MIME

GENA has a POLL and NOTIFY method.

The client can use the POLL method to ask for available events.

Symmetric HTTP - When the client SUBSCRIBE includes a Call-Back: HTTP
header, the server can use the NOTIFY method to deliver asynchronous events
to the client.  This assumes that the client is also running an HTTP server,
for symmetric HTTP.

In 1999, this was only feasible within intranets or sans-firewall setups.
However, with h2/h3 this may be feasible. 

 


Event payload


MNOT carries event data in the http headers.  1xx responses prohibit bodies.

BRAID contains the content of the resource at a specific version, or a patch
from a previous version

PREP includes the current state of the resource and information about the
HTTP requests that changed the resource state including HTTP method,
timestamp, Etag, Event-ID

GENA body is optional, and unspecified type

 


Discovery


MNOT can use OPTIONS

BRAID is Star Trek VI: The Undiscovered Country

PREP uses HEAD and checks for Accept-Events: HTTP header

GENA can use OPTIONS


Examples


MNOT


Subscription


SUB /foo/stream HTTP/2

Host: example.com

HTTP/2 105 PUB

Date: Sun, 20 Feb 2022 04:36:53 GMT

My-App-Data: 54

Last-Event-ID: 1

 

HTTP/2 105 PUB

Date: Sun, 20 Feb 2022 04:37:05 GMT

My-App-Data: 42

Last-Event-ID: 2

 

HTTP/2 105 PUB

Date: Sun, 20 Feb 2022 04:38:31 GMT

My-App-Data: 36

Last-Event-ID: 3

 


Discovery


OPTIONS /foo/stream HTTP/2

 

HTTP/2 200 OK

Allow: SUB


BRAID


Subscription


GET /chat

Subscribe: true

 

HTTP/1.1 209 Subscription

Subscribe: true

 

Version: "ej4lhb9z78"

Parents: "oakwn5b8qh", "uc9zwhw7mf"

Content-Type: application/json

Merge-Type: sync9

Content-Length: 64

 

[{"text": "Hi, everyone!",

  "author": {"link": "/user/tommy"}}]

 

Version: "g09ur8z74r"

Parents: "ej4lhb9z78"

Content-Type: application/json

Merge-Type: sync9

Patches: 1

 

Content-Length: 53

Content-Range: json .messages[1:1]

 

[{"text": "Yo!",

  "author": {"link": "/user/yobot"}]


BRAID (Multiresponse
<https://datatracker.ietf.org/doc/html/draft-toomim-httpbis-versions#section
-2.4.4> )



GET /chat
Subscribe: true



HTTP/1.1 209 Multiresponse
Subscribe: true



  HTTP/1.1 200 OK
  Version: "2"
  Parents: "1a", "1b"
  Content-Type: application/json
  Content-Length: 64



  [{"text": "Hi, everyone!",
  "author": {"link": "/user/tommy"}}]

  HTTP/1.1 200 OK
  Version: "3"
  Parents: "2"
  Content-Type: application/json
  Merge-Type: sync9
  Content-Length: 117

  [{"text": "Hi, everyone!",
  "author": {"link": "/user/tommy"}}
  {"text": "Yo!",
  "author": {"link": "/user/yobot"}]




PREP


GET /foo HTTP/1.1

Host: example.org

Accept-Events: "prep"

 

HTTP/1.1 200 OK

Last-Modified: Sat, 1 April 2023 10:11:12 GMT

Transfer-Encoding: chunked

ETag: 1234abcd

Events: protocol="prep", status=200

Vary: Accept-Events

Accept-Events: "prep"; accept="message/rfc822"

Content-Type: multipart/mixed; boundary="MAIN-SEPARATOR"

 

--MAIN SEPARATOR

Content-Type: text/plain

 

Hello World!

 

--MAIN-SEPARATOR

Content-Type: multipart/digest; boundary="MESSAGE-SEPARATOR"

 

--MESSAGE-SEPARATOR

 

Method: PUT

Date: Sat, 1 April 2023 10:11:12 GMT

Event-ID: 456

E-tag: 6789wxyz

 

 

--MESSAGE-SEPARATOR

 

Method: DELETE

Date: Sat, 1 April 2023 10:11:12 GMT

Event-ID: 789

 

 

--MESSAGE-SEPARATOR--

--MAIN-SEPARATOR--

 


Discovery


HEAD /foo HTTP/1.1

Host: example.org

 

HTTP/1.1 200 OK

Accept: text/html

Accept-Events: "prep"; accept="message/rfc822"

 

 


GENA


Subscribe


SUBSCRIBE URI HTTP/1.1

Notification-Type: CoreNotificationType

Call-back: cbURI [ URI  ]

Delivery-control: poll-interval = seconds

Subscription-Lifetime: 900 

Notification-Version: 1.0

     

HTTP/1.1 200 Subscribed

Notification-Version: 1.0

Call-back: [ accepted callback URIs]

Delivery-control: poll-interval = acc

Subscription-Lifetime: 900

Subscription-ID: FFFFF

     


Asynchronous NOTIFY


NOTIFY cbURI HTTP/1.1

Subscription-ID: FFFF (optional)

Notification-Type: UPDATE

Notification-Version: 1.0

Content-Type:


Synchronous POLL


POLL URI HTTP/1.1

Subscription-ID: FFFF

Delivery-control: Wait-time=20

     

HTTP/1.1 200 Notification

Subscription-ID: FFFF

Notification-Type: UPDATE

     


Discovery


OPTIONS URI HTTP/1.1

 

HTTP/1.1 200 OK

Allow: SUBSCRIBE, POLL, NOTIFY

Received on Monday, 12 August 2024 17:49:47 UTC