9.0.0 • Published 2 years ago

@gabliam/amqp v9.0.0

Weekly downloads
74
License
MIT
Repository
github
Last release
2 years ago

Build Status NPM version

Gabliam amqp

Gabliam plugin for add amqp.

How to use

Installation

$ yarn add @gabliam/amqp

Register plugin

In your main, add amqp plugin

import 'reflect-metadata';
import path from 'path';
import { Gabliam } from '@gabliam/core';
import amqpPlugin from '@gabliam/amqp';

new Gabliam({
  scanPath: __dirname,
  config: path.resolve(__dirname, '../config'),
})
  .addPlugins(amqpPlugin)
  .buildAndStart();

Create a controller

import { RabbitController, RabbitListener, RabbitConsumer } from '@gabliam/amqp';
@RabbitController()
export class HelloRabbitMq {
  

  @RabbitListener('logHi')
  async logHi() {
    console.log('hi');
  }

  @RabbitConsumer('hello')
  async hello(@Content('name') name: string ) {
    return `hello ${$name}`
  }
}

Configuration

Configuration for this plugin is in application.amqp

You can add just one connection configuration or an array of connections configurations

Connection configuration

keytyperequireddefaultdescription
namestringdefaultname of the connection
urlstringXurl of the rabbitmq
undefinedValuestring$$__##UNDEFINED##__$$value that's send when content is undefined
queuesMap of queue configurationXMap of queues

Queue configuration

keytyperequireddefaultdescription
queueNamestringXname of the queue
options.exclusivebooleanfalseif true, scopes the queue to the connection (defaults to false)
options.durablebooleanfalseif true, the queue will survive broker restarts, modulo the effects of exclusive and autoDelete; this defaults to true if not supplied, unlike the others
options.autoDeletebooleanfalseif true, the queue will be deleted when the number of consumers drops to zero (defaults to false)

License

MIT

9.0.0

2 years ago

8.11.1

3 years ago

8.11.0

4 years ago

8.10.0

5 years ago

8.9.0

5 years ago

8.8.0

5 years ago

8.7.1

5 years ago

8.7.0

5 years ago

8.6.0

5 years ago

8.5.1

6 years ago

8.4.0

6 years ago

8.5.0

6 years ago

8.3.0

6 years ago

8.2.1

6 years ago

8.2.0

6 years ago

8.1.0

6 years ago

7.15.2

6 years ago

8.0.4

6 years ago

8.0.3

6 years ago

8.0.2

6 years ago

7.15.1

6 years ago

8.0.1

6 years ago

8.0.0

6 years ago

7.15.0

6 years ago

8.0.0-alpha.115

6 years ago

8.0.0-alpha.114

6 years ago

8.0.0-alpha.113

6 years ago

8.0.0-alpha.112

6 years ago

8.0.0-alpha.109

6 years ago

8.0.0-alpha.106

6 years ago

8.0.0-alpha.105

6 years ago

8.0.0-alpha.98

6 years ago

8.0.0-alpha.97

6 years ago

8.0.0-alpha.57

7 years ago

8.0.0-alpha.55

7 years ago

7.11.2

7 years ago

7.11.0

7 years ago

7.10.1

7 years ago

7.10.0

7 years ago

7.9.5

7 years ago

7.9.4

7 years ago

7.9.3

7 years ago

7.9.2

7 years ago

7.9.0

7 years ago

7.8.2

7 years ago

7.7.0

7 years ago

7.6.2

7 years ago

7.6.1

7 years ago

7.6.0

7 years ago

7.5.0

7 years ago

7.4.0

7 years ago

7.3.0

7 years ago

7.2.0

8 years ago

7.1.1

8 years ago

7.0.0

8 years ago

6.3.0

8 years ago

6.2.4

8 years ago

6.2.3

8 years ago

6.2.2

8 years ago

6.2.1

8 years ago

6.2.0

8 years ago

6.1.0

8 years ago

6.0.0

8 years ago

5.0.0

8 years ago

4.0.0

8 years ago

4.0.0-2

8 years ago

4.0.0-1

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.6.0

8 years ago

1.5.0

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago