# amqplib-publish-subscribe

> Simplified API for Pub/Sub with amqplib (e.g. RabbitMQ)

Latest version **0.0.1** (published 2017-02-08) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install amqplib-publish-subscribe
pnpm add amqplib-publish-subscribe
yarn add amqplib-publish-subscribe
bun add amqplib-publish-subscribe
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-02-08 |
| First published | 2017-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jeff Donios |
| Maintainers | donios |
| Keywords | RabbitMQ, CloudAMQP, AMQP, 0-9-1, AMQP, amqplib, pubsub |

## Links

- npm: https://www.npmjs.com/package/amqplib-publish-subscribe
- Repository: https://github.com/doniosjm/amqplib-publish-subscribe
- Homepage: https://github.com/doniosjm/amqplib-publish-subscribe#readme
- Issues: https://github.com/doniosjm/amqplib-publish-subscribe/issues
- npm.io page: https://npm.io/package/amqplib-publish-subscribe

## Dependencies (2)

- [amqplib](https://npm.io/package/amqplib.md) ^0.4.2
- [amqplib-topology](https://npm.io/package/amqplib-topology.md) ^2.0.0

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2017-02-08

## README

# amqplib-publish-subscribe
Simplified API for Pub/Sub with amqplib (e.g. RabbitMQ)

## Dependencies

https://www.npmjs.com/package/amqplib

## Example

```js
var pubSub = new PubSub(options);
 
// connect
pubSub.connect('My Pub/Sub', function(err, pubSub){
        
    // Asserts a temporary, exclusive queue and creates a binding to receive fanout exchange messages
    pubSub.subscribeToFanout({}, 'amqp.fanout', '', function(msg, cb){
        // do work
        cb(true); // ack the message
    });
     
});
 
// publish
var count = 1;
setInterval(function () {
    // publish a message to a fanout exchange
    pubSub.publishToFanout({}, 'amqp.fanout', 'event.message', 'my message body');
    count++;
}, 4000);

```

## Options

### `name`

If specified, this will name the connection and used in console output when debug is enabled

### `debug`

Enable/disable console output

### `debugPrefix`

Used to identify console output when debug is enabled
 
### `endpoint`
 
AMQP server endpoint

## MIT Licenced

---
_Source: https://npm.io/package/amqplib-publish-subscribe · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
