0.1.24 • Published 3 years ago

amqp-pro v0.1.24

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

AMQP Pro

CI Pipeline License: MIT

A high-level AMQP client with built-in reconnect.

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

Installation

Install the npm package using npm or yarn!

npm install amqp-pro
yarn add amqp-pro

Usage

Amqp Pro provides a simple interface for connecting, creating a channel, and subscribing and publishing messages.

The general flow for setting up a subscriber is to create the connection, create the channel, and then subscribe to the channel with a handler that processes incoming messages.

const connection = await amqpPro.connect('amqp://your-channel');

const channel = await amqpPro.createChannel(
  connection,
  'your channel name'
);

amqpPro.subscribe(
  channel,
  'your channel name',
  (msg: JSON) => { handler(msg); }
);

Publishing is done in a similar manner.

interface Payload {
  example: string;
}

const connection = await amqpPro.connect('amqp://your-channel');

const channel = await amqpPro.createChannel(
  connection,
  'your channel name'
);

const payload = {
  example: 'o hi mark'
};

amqpPro.publish<Payload>(
  channel,
  'your channel name',
  payload
);

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Sam Hall

0.1.24

3 years ago

0.1.23

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago