You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.
Extend the OpenApi schema to support PubSub. Defining PubSub inside of events allows us to generate typed clients that know how to subscribe to events. It furthermore allows to generate typed servers that understand what these events look like and how events can be published. For an example of the schema as well as the generated code see the sections below.
In addition to generating types and handling them in a type safe and validated way, defining the PubSub mechanism inside of the schema would enable deployment pipelines to automatically perform the necessary bootstrapping. E.g. A deployment pipeline could inspect the publishers section and then set up a new AWS Queue.
Requirements:
Support different PubSub mechanisms (e.g. local, SQS, SNS)
Subscriptions describe how the service connects to publishers. In the case of SNS/SQS a deployment pipeline could create the actual subscription on AWS while Slushy takes care of listening to the events and forwarding them to the appropriate endpoint.
Example subscription:
TODO
subscriptions:
petShopEvents:
SQS:
arn: {petShopEventsSQSArn}:pet-shop-events# This references the SNS services this queue is subscribed to. It provides the url and the expected schema.SNS:
# This publisher has write permissionspermissions: ["SQS:SendMessage"]$ref: 'https://my-schemas/petShop/#/publishes/petShopEvents/SNS'
Example code generated:
TODO
The text was updated successfully, but these errors were encountered:
Extend the OpenApi schema to support PubSub. Defining PubSub inside of events allows us to generate typed clients that know how to subscribe to events. It furthermore allows to generate typed servers that understand what these events look like and how events can be published. For an example of the schema as well as the generated code see the sections below.
In addition to generating types and handling them in a type safe and validated way, defining the PubSub mechanism inside of the schema would enable deployment pipelines to automatically perform the necessary bootstrapping. E.g. A deployment pipeline could inspect the publishers section and then set up a new AWS Queue.
Requirements:
Related work:
Publishing describes how a service publishes events and what shape the events have.
Example publishing:
Subscriptions describe how the service connects to publishers. In the case of SNS/SQS a deployment pipeline could create the actual subscription on AWS while Slushy takes care of listening to the events and forwarding them to the appropriate endpoint.
Example subscription:
TODO
Example code generated:
TODO
The text was updated successfully, but these errors were encountered: