Optionaloptions: DatabaseOutboxStoreOptions
The outbox entity and the database connection
A factory the messaging plugin resolves in onInit
When entity is empty or database is not a legal
connection name — at the call, before any application starts
import { createDatabaseOutboxStore, DatabasePlugin } from '@setu-ts/database-plugin';
import { MessagingPlugin } from '@setu-ts/messaging-plugin';
const app = createApplication({
plugins: [
DatabasePlugin({ type: 'memory' }),
MessagingPlugin({ outbox: { store: createDatabaseOutboxStore() } }),
],
});
Builds the outbox store bridge as a
RegistryFactory, for the messaging plugin'soutbox.storeoption.The factory resolves
CAPABILITIES.DATABASE(ordatabase.<name>) from the registry it is handed — typed asIDatabaseService, the token's documented interface — and returns anIOutboxStoreover it. The messaging plugin resolves it inonInit, soDatabasePluginmay be registered before or after the messaging plugin, and runsverify()there.Per backend. Memory, Prisma, Drizzle (with the outbox table in
drizzleTables), D1, a MongoDB replica set, DynamoDB with a GSI{ partitionKey: 'status', sortKey: 'position' }(projectionALL), and Cosmos with the outbox entity mapped to the business container and a partition-key path the row carries (tenantIdororderingKey) are supported.verify()refuses Bigtable, a standalone MongoDB, a DynamoDB entity without that GSI, and a missing or unreadable entity, each by name with anOutboxStoreUnavailableError.