Publishers

Stream Operations Publishers are used to publish messages on streams. They consist of a number of components:

ComponentAsyncApi DocumentorDocumentation Model
Your Message Publisher (service)--
Your Output Port (struct)asyncapi.MessagePublisherDocumentorjsonschema.Schema
Your Payload DTO (struct)asyncapi.MessagePublisherDocumentorjsonschema.Schema
streamops.MessagePublisherasyncapi.MessagePublisherDocumentorasyncapi.Message
streamops.ChannelPublisherasyncapi.ChannelPublisherDocumentorasyncapi.Operation
streamops.Channelasyncapi.ChannelDocumentorasyncapi.Channel

Components

Channel

The channel component represents the stream itself (SQS or Kafka topic, Redis stream, Go channel, SQLDB table, etc). It is implemented as a singleton that should be created after configuration but before start-up.

Channel Publisher

The channel publisher component represents the set of publishable messages for a given stream. It is implemented as a service that should be created as a dependency of your message publisher.

Message Publisher

The message publisher component represents one of the publishable messages for a given stream. It is implemented as a service created after configuration but before start-up.
Notice that it has a defined API interface for mocking, and should be mocked by dependent services during testing.

Output Port

The message port contains a mapping of fields to be set on the outgoing message. Each field will be mapped to a header or body field based on the struct tags.

Message Payload DTO

The payload DTO will contain the body of message that is to be published. Before dispatch to the underlying stream, the message will be validated using the JSON-schema annotations on your DTO.

Generation

It is strongly advised to auto-generate these components and customize them afterwards. See Channels and AsyncApi for details about generation.