0.7.2 • Published 5 months ago

@yourrentals/cloudevent-publisher-nestjs v0.7.2

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

@yourrentals/cloudevent-publisher-nestjs

This library defines a JS library to publish messages to the message bus.

Installation

yarn add @yourrentals/cloudevent-publisher-nestjs

Usage

import { CloudeventPublisherModule } from '@yourrentals/cloudevent-publisher-nestjs';

@Injectable()
export class FeatureService {
  constructor(private readonly publisher: CloudEventPublisherService) {}

  async doSomething() {
    await this.publisher.publish('my-event', {
      data: {
        foo: 'bar',
      },
    });
  }
}

@Module({
  imports: [
    CloudeventPublisherModule.forFeature({
      topics: [
        {
          eventType: 'my-event',
          topicArn: 'arn:aws:sns:eu-west-1:123456789012:my-topic',
        },
      ],
    }),
  ],
  providers: [FeatureService],
})
export class FeatureModule {}

@Module({
  imports: [
    CloudeventPublisherModule.forRoot({
      source: 'publisher',
    }),
    FeatureModule,
  ],
})
export class AppModule {}
0.7.2

5 months ago

0.7.1

5 months ago

0.6.1

7 months ago

0.6.0

7 months ago

0.5.2

7 months ago

0.5.1

7 months ago

0.5.0

7 months ago

0.4.3

7 months ago

0.4.2

7 months ago

0.4.1

7 months ago

0.1.4

8 months ago