Rabbitode is a probject created to provide a simple interface in order to work with the AMQP interface to rabbitmq. RabbitMQ is an events broker that allows us to send a recieve events between producers and consumers via an event queue.

Installation

Installation via npm npm install rabbitode

Requirements

In order for this project to run you must have a working instance of rabbitmq on your machine or server. I reccomend docker for local development. docker run -p 5672:5672 -d --rm --name rabbit rabbitmq:3

Api

Creating a connection

import { RabbitMqInterface } from ' rabbitode ' ; ; myConnection . setRabbitUri ( ' http://myconnection ' ) ; myConnection . sendDirect ( ) ; myConnection . startDirectConsumer ( ) ;

API

Send Direct

rabbitInterface . sendDirect ( ) ;

Send Fanout

rabbitInterface . sendFanout ( ) ;

Send Topic

rabbitInterface . sendTopic ( ) ;

Consumer Direct

rabbitInterface . startDirectConsumer ( ) ;

Consumer Fanout

rabbitInterface . startFanoutConsumer ( ) ;

Consumer topic

; rabbitInterface . startTopicConsumer ( , myTopics ) ;

Consumer Handler

;

Set custom uri

myConnection . setRabbitUri ( ' http://mylocation ' ) ;

Enable debugging

myConnection . enableDebugging ( ) ;

Disable debugging

myConnection . disableDebugging ( ) ;

Decode to JSON

will check if message content is JSON or Return undefined

myConnection . decodeToJson ( message ) ;

Decode to String

myConnection . decodeToString ( message ) ;

Changes

Most methods return this to enable method chaining

send method no longer available, use sendDirect, sendTopic, sendFanout instead

Security Vulnerability fixes in package.json

Copyright

Copyright 2018 Evan Burbidge

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.