Google PubSub
Google Pub/Sub Channel Integration
📦 Installation
npm install @nestjstools/messaging @nestjstools/messaging-google-pubsub-extensionyarn add @nestjstools/messaging @nestjstools/messaging-google-pubsub-extension⚙️ Example Configuration
import { MessagingModule } from '@nestjstools/messaging';
import { PubSubChannelConfig, MessagingGooglePubSubExtensionModule } from '@nestjstools/messaging-google-pubsub-extension';
import { InMemoryChannelConfig } from '@nestjstools/messaging/channels';
import { SendMessageHandler } from './handlers/send-message.handler';
@Module({
imports: [
MessagingGooglePubSubExtensionModule,
MessagingModule.forRoot({
messageHandlers: [SendMessageHandler],
buses: [
{
name: 'default.bus',
channels: ['in-memory', 'pubsub-events'],
},
],
channels: [
new InMemoryChannelConfig({
name: 'in-memory',
avoidErrorsForNotExistedHandlers: true,
}),
new PubSubChannelConfig({
name: 'pubsub-events',
projectId: 'your-gcp-project-id',
topic: 'your-topic-name',
subscription: 'your-subscription-name',
middlewares: [],
autoCreate: true,
enableSubscriber: true,
avoidErrorsForNotExistedHandlers: true,
}),
],
debug: true,
}),
],
})
export class AppModule {}🛠️ PubSubChannelConfig Properties
Property
Description
Default Value
🌐 Key Features
Last updated