Skip to content

Remove Concept of Multiple Protocols within HTTP #266

Closed

Description

@grant

Expected

We by default use the HTTP protocol for CloudEvents.
We do not need to specify if the CloudEvent module accepts only binary or only structured events.

Actual

We specify the protocol in the Receiver constructor. Not sure why.
Seems overly complicated.

https://github.com/cloudevents/sdk-javascript/blob/master/src/transport/receiver.ts#L40
https://github.com/cloudevents/sdk-javascript/blob/master/src/transport/protocols.ts

Activity

  1. grant commented on Jul 23, 2020

    @grant
    MemberAuthor

    I would assume the Receiver to only have static methods in the first place and not be an object.

    Why would an application want to have to manage multiple CloudEvent receivers rather than static receivers?

  2. grant commented on Jul 23, 2020

    @grant
    MemberAuthor

    This would greatly simplify a lof of the extra logic I see in the module.

    We can always add in protocols later, but I suggest removing it for now.

  3. lance commented on Jul 23, 2020

    @lance
    Member

    I actually have tentative requirements for MQTT, AMQP and/or Kafka and that's why Receiver optionally accepts a protocol. I can see an argument to be made for making accept() a static method on Request or even just a standalone function. This would mean that we would need to add a third, optional protocol parameter to accept().

  4. grant commented on Jul 23, 2020

    @grant
    MemberAuthor

    I'm fine having an optional parameter to accept() rather than 100 dangling CloudEvent acceptor objects in my code.

    I know that is a stretch, but I'd really like it to be static, or at least have the option of being static.
    With CloudEvents, things are fully-encapsulating and stateless, so the less state we can have, the better.

    Happy to keep the protocol list and have TODOs for those other protocols, especially if you might have requirements for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions