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

simple-message-helper

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-message-helper

Provides a simple interface for a single-exchange, single-queue message pattern

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Message Helper

This simplifies interactions for working with a message broker when you really don't need a full feature set - basically just send and receive. It's written in CoffeeScript and is used downstream to run chatops tasks as part of a Hubot deployment.

Basic usage

var readyFn = function() {
    console.log("Connected and configured");

    communicator.send("Do stuff");
};

var messageHandler = function(message) {
    console.log("Got a message:", message);
};

var disconnected = function() {
    console.log("Disconnected");
}

var messageHelper = require('message-helper')
var communicator = new messageHelper(readyFn, messageHandler, disconnected);

From the above, you'd expect the message "Do stuff" to get published to your exchange.

Configuration

You can use the default configuration:

configuration =
    user: "guest"
    password: "guest"
    host: "localhost"
    port: 5672
    vhost: "/"
    commandExchangeName: "hubot-commands"
    commandRoutingKey: "hubot-commands"
    responseExchangeName: "hubot-responses"
    responseQueueName: "hubot-responses"

Or, use custom environment variables:

export AMQP_USER="amqp_user"
export AMQP_PASSWORD="amqp_password"
export AMQP_HOST="amqp_host"
export AMQP_PORT="amqp_port"
export AMQP_VHOST="amqp_vhost"
export AMQP_COMMAND_EXCHANGE_NAME="amqp_command_exchange_name"
export AMQP_COMMAND_ROUTING_KEY="amqp_command_routing_key"
export AMQP_RESPONSE_EXCHANGE_NAME="amqp_response_exchange_name"
export AMQP_RESPONSE_QUEUE_NAME="amqp_response_queue_name"

Keywords

FAQs

Package last updated on 03 Jun 2015

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