@ccmos/nestjs-amqplib
v0.0.10
Published
<p align="center"> <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a> </p>
Readme
Description
Nest framework TypeScript starter repository.
Installation
$ npm install @ccmos/nestjs-amqplibQuick Start
// import
import { Module } from '@nestjs/common';
import { AmqplibModule } from '@ccmos/nestjs-amqplib';
@Module({
imports: [
AmqplibModule.forRoot({
url: 'amqp://localhost'
}),
],
})
export class AppModule {}
// service
import { Injectable } from '@nestjs/common';
import { AmqplibService } from '@ccmos/nestjs-amqplib';
@Injectable()
export class MyService {
constructor(
private amqplib: AmqplibService,
) { }
async helloWorld() {
await amqplib.sendToQueue('testQueue', { hello: 'queue' });
await service.publish('testExchange', 'testRoutingKey', {
hello: 'exchange',
});
}
}License
Nest is MIT licensed.
