An open API service indexing awesome lists of open source software.

https://github.com/robertoachar/node-rabbitmq

A playground for Node and RabbitMQ.
https://github.com/robertoachar/node-rabbitmq

microservice node rabbitmq

Last synced: 11 months ago
JSON representation

A playground for Node and RabbitMQ.

Awesome Lists containing this project

README

          

# Node with RabbitMQ

Generated by [OSS Project Generator](http://bit.ly/generator-oss-project).

[![License][license-badge]][license-url]

> A playground for Node and RabbitMQ.

# Installation

## Windows Installation

* Install Node.js: [node-v8.5.0-x64.msi](https://nodejs.org/dist/v8.5.0/node-v8.5.0-x64.msi)

* Install Erlang : [otp_win64_20.0.exe](http://erlang.org/download/otp_win64_20.0.exe)

* Install RabbitMQ: [rabbitmq-server-3.6.12.exe](https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_6_12/rabbitmq-server-3.6.12.exe)

* Update npm (current version v5.3.0)

```bash
$ npm i -g npm@5.3.0
```

## Enable RabbitMQ Management Plugin (optional)

```bash
$ cd C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.12\sbin
$ rabbitmq-plugins enable rabbitmq_management
```

Browser to: [http://localhost:15672](http://localhost:15672)

* Username: guest
* Password: guest

# Development

* Cloning the repo

```bash
$ git clone https://github.com/robertoachar/node-rabbitmq.git
```

* Installing dependencies

```bash
$ npm install
```

* Running scripts

Action | Usage
------ | -----
Linting code | `npm run lint`

# Usage

* Hello World

```bash
# producer
$ node src/hello-world/producer.js

# consumer
$ node src/hello-world/consumer.js
```

# Troubleshooting

## Installing as a non-administrator user leaves .erlang.cookie in the wrong place

This makes it impossible to use `rabbitmqctl`.

Workarounds:

* Run the installer as an administrator _or_;
* Copy the file `.erlang.cookie` manually from `%SystemRoot%` to `%HOMEDRIVE%%HOMEPATH%`.
* Restart service (stop and start)

# Author

[Roberto Achar](https://twitter.com/robertoachar)

# License

[MIT](https://github.com/robertoachar/node-rabbitmq/blob/master/LICENSE)

[license-badge]: https://img.shields.io/github/license/robertoachar/node-rabbitmq.svg
[license-url]: https://opensource.org/licenses/MIT