TypeORM driver for @fullstackhouse/nestjs-outbox.
- PostgreSQL & MySQL Support: Works with postgres and mysql drivers
npm install @fullstackhouse/nestjs-outbox-typeorm-driverimport { OutboxModule } from '@fullstackhouse/nestjs-outbox';
import {
OutboxTransportEventMigrations,
TypeORMDatabaseDriverFactory,
TypeOrmOutboxTransportEvent,
} from '@fullstackhouse/nestjs-outbox-typeorm-driver';
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { DataSource } from 'typeorm';
@Module({
imports: [
TypeOrmModule.forRoot({
type: 'postgres',
host: 'localhost',
port: 5432,
username: 'user',
password: 'user',
database: 'outbox',
entities: [TypeOrmOutboxTransportEvent],
migrations: [...OutboxTransportEventMigrations],
migrationsRun: true,
}),
OutboxModule.registerAsync({
imports: [TypeOrmModule.forFeature([TypeOrmOutboxTransportEvent])],
useFactory: (dataSource: DataSource) => ({
driverFactory: new TypeORMDatabaseDriverFactory(dataSource),
events: [
{
name: 'OrderCreatedEvent',
listeners: {
retentionPeriod: 1000 * 60 * 60 * 24, // 24 hours
maxExecutionTime: 1000 * 15, // 15 seconds
maxRetries: 5, // max retry attempts
},
},
],
pollingInterval: 30_000,
maxEventsPerPoll: 10,
}),
inject: [DataSource],
}),
],
})
export class AppModule {}| Database | Real-time Support |
|---|---|
| PostgreSQL | Polling only |
| MySQL | Polling only |
MIT