Skip to content

Event Store Subscriptions

Event store subscriptions let one event store consume events produced in another event store. You configure subscriptions on a target event store and point each subscription to a source event store and a set of event types.

Lists all event store subscriptions configured for the target event store.

Terminal window
cratis chronicle subscriptions list --event-store <TARGET_EVENT_STORE>

List subscriptions for the system event store:

Terminal window
cratis chronicle subscriptions list --event-store system

List in plain format:

Terminal window
cratis chronicle subscriptions list --event-store system --output plain

Adds an event store subscription to the target event store.

Terminal window
cratis chronicle subscriptions add <SUBSCRIPTION_ID> <SOURCE_EVENT_STORE> <EVENT_TYPES> --event-store <TARGET_EVENT_STORE>
ArgumentDescription
SUBSCRIPTION_IDUnique identifier for the subscription.
SOURCE_EVENT_STOREEvent store to subscribe from.
EVENT_TYPESComma-separated list of event type IDs to include.

Add a subscription from default to system for one event type:

Terminal window
cratis chronicle subscriptions add orders-from-default default MyCompany.Sales.OrderPlaced --event-store system

Add a subscription with multiple event types:

Terminal window
cratis chronicle subscriptions add sales-feed default MyCompany.Sales.OrderPlaced,MyCompany.Sales.OrderCancelled --event-store system

Removes an event store subscription from the target event store.

Terminal window
cratis chronicle subscriptions remove <SUBSCRIPTION_ID> --event-store <TARGET_EVENT_STORE>

The command prompts for confirmation before proceeding. Pass --yes to skip the prompt in automated workflows.

ArgumentDescription
SUBSCRIPTION_IDIdentifier of the subscription to remove. Use subscriptions list to retrieve IDs.
FlagDescription
-y, --yesSkip confirmation prompt.

Remove a subscription interactively:

Terminal window
cratis chronicle subscriptions remove orders-from-default --event-store system

Remove without confirmation:

Terminal window
cratis chronicle subscriptions remove orders-from-default --event-store system --yes