Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amqplib-rpc-client

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amqplib-rpc-client

Rpc client based on amqplib.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

amqplib-rpc-client

Rpc client based on amqplib.

build status

Installation

This module is installed via npm:

$ npm install amqplib-rpc-client

Example Usage

var amqplibRpcClient = require('amqplib-rpc-client'),
    expect = require('expect.js');

amqplibRpcClient(amqpUrl, exchange, 'add', { number1: 1, number2: 4 }).on('data', function(response) {
  expect(response.answer).to.be(5);
});

Usage/conventions

Uses the replyTo field to transmit the expected routingKey a response should be publish on by the server. Expects message to be valid JSON. Will emit() events based on the type field of the message content. The entire JSON object is given as arg 2. e.g: emit('data', { type: 'data', result: 'moo' });

Running tests

npm test

To run the tests RabbitMQ is required. Either install it with your package manager, or use docker to run a RabbitMQ instance.

docker run -d --name amqp.test -p 5672:5672 rabbitmq

Keywords

FAQs

Package last updated on 09 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc