Publishing Events
Once your first tenant is created, you can publish events to it. Events are published in one of two ways:
- Publishing to a configured message bus queue that Outpost will consume
- Making an HTTP POST request to the Publish API endpoint
Using the message queue allows for a higher publishing guarantee since there are no other dependencies other than the message queue, and you may already be publishing events requiring minimal change on your end.
Using the publishing API endpoint allows you to avoid implementing publishing to your service bus. It removes the initial publishing cost, but it adds the risk of the Outpost API being unavailable or returning an error.
The events need to follow the given structure:
json
Each event (without a destination_id
) is evaluated against all the registered destinations. An event is delivered and logged for each eligible destination.
The metadata
is translated to the destination's native metadata; for instance, with Webhooks, they are translated to HTTP headers. If the destination does not support metadata, the metadata will be included in the event payload.
Publishing from a message bus
Refer to the respective guide for the message bus you are using to publish events:
Event Fanout
A message published to a topic is automatically replicated and sent to multiple endpoints. This allows for parallel processing and asynchronous event notifications.