When publishing a message to the stream, the configuration can include a transaction object to execute the operation atomically and/or a retry policy to control retry behavior.

interface PublishMessageConfig {
    retryPolicy?: RetryPolicy;
    transaction?: ProviderTransaction;
}

Properties

retryPolicy?: RetryPolicy

Retry policy for this specific message. Overrides stream-level and app-level defaults.

await streamService.publishMessages('my-topic', [msg], {
retryPolicy: {
maximumAttempts: 10,
backoffCoefficient: 2,
maximumInterval: '600s',
}
});
transaction?: ProviderTransaction