An open API service indexing awesome lists of open source software.

https://github.com/mosluce/nestjs-amqplib


https://github.com/mosluce/nestjs-amqplib

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        


Nest Logo

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

A progressive Node.js framework for building efficient and scalable server-side applications.



NPM Version
Package License
NPM Downloads
CircleCI
Coverage
Discord
Backers on Open Collective
Sponsors on Open Collective

Support us


## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

## Installation

```bash
$ npm install @ccmos/nestjs-amqplib
```

## Quick Start

```js
// 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](LICENSE).