amqp-pro v0.1.24
AMQP Pro
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Sam Hall
- @biggHealthy_
- hallsamuel90@gmail.com