Skip to content

vudc/nestjs-activemq

Repository files navigation

Nestjs - ActiveMQ

Installation

Copy dependency @nestjs/activemq to your package.json

"dependencies": {
    "@nestjs/activemq": "git+https://github.com/vudc/nestjs-activemq"
  }

Run

npm install

Usage

//app.module.ts
import { ActiveMQModule } from '@nestjs/activemq'

@Module({
    imports: [{
        ActiveMQModule.forRoot({
            host: 'localhost',
            port: 61613,
            username: 'admin',
            password: 'admin',
            maxConnection: 5
        })
    }]
})
//foo.listener.ts

import { ActiveMQHandler } from '@nestjs/activemq'

export class FooListener {
    constructor(@Inject('ACTIVEMQ_PROVIDER') readonly handler: ActiveMQHandler) {
        handler.subscribe('QUEUE_NAME', (err, data) => {
            ...
        })
    }
}

About

ActiveMQ strategy and client for nestjs microservice

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors