amqplib-simple

2.2.1 • Public • Published

amqplib-simple

Coverage Status

Simple interface to stablsis a connection, publish and consume messages based on configuration.

Install it using npm:

    npm i amqplib-simple

Create a new instance:

    const amqplibSimple = require('amqplib-simple')

Connection can be stablished with connect method, and the same connection can be closed using the close method or directly calling the close mehtod inside the connection object.

    const { connect } = amqplibSimple.connection

    connect(
        amqplibInstance, connString, exchangeName,
        exchangeType, queueName, queueArgs, routingKey
    )

Consumer offers a method to consume messages using a given async resolver function

    const { consume } = amqplibSimple.consumer
    const customResolver = () => Promise.resolve()

    consume(connection, customResolver)

Publisher offers a method to publish a new message for given channel

    const { publishOne } = amqplibSimple.publisher

    publishOne(msg, channel, exchangeName, queueName)

Dependencies (1)

Dev Dependencies (9)

Package Sidebar

Install

npm i amqplib-simple

Weekly Downloads

1

Version

2.2.1

License

ISC

Unpacked Size

22.3 kB

Total Files

18

Last publish

Collaborators

  • murcialito