Giter Club home page Giter Club logo

hipchatwebqueue's Introduction

Hipchat Web Queue

This package is designed to create a simple tunnel for hipchat messages from a publicly exposed server which can be subscribed to by an internal server. It acts as an HTTP server which will accept POST requests from from a hipchat web hook, and will pipe those into a RabbitMq exchange.

Setup

  • Set up a rabbitMq server, and (with proper secutity settings in place) expose its port publicly
  • Set up a rabbitMq exchange called "hipchat_messages" and a user with write access to that exchange
  • Set up a server to act as the public HTTP server (can be the same one as the rabbitMq server) with node.js installed
  • Clone this repository and run app.js with environment variable AMQP_CONN set to an amqp connection URL (I.E. "amqp://user:[email protected]")
  • You're good to go! I reccomend using PM2 to manage the node.js process and environment variables for the server

Usage

  • Add a hipchat "BYO" addon and list your server with path /message/:routingKey (I.E. http://my.http.server/message/sample) for the POST url.
  • Add a rabbitMq queue, and bind it to the "hipchat_messages" exchange with the routing key set as the routing key used above.
  • Add a rabbitMq user with read access to that queue
  • Install and use the node.js client library below

Client

Installation:

npm install hipchat-webqueue-client --save

Usage:

const HipchatQueueClient = require("hipchat-webqueue-client");

const queue = new HipchatQueueClient({ username: "user", password: "password", endpoint: "my.rabbitmq.server", queue: "sample" });

queue.messages.subscribe(msg => console.log(msg));

queue.connect().then(() => console.log("Connected"));

Construct the client with an object with the following properties:

  • username: RabbitMq username with read access to the queue
  • password: RabbitMq password
  • endpoint: RabbitMq domain name
  • queue: RabbitMq queue to read from

The messages property exposes an Rx Observable which can be subscribed to to recieve messages. No actual messages will be recieved until connect() is called. The connect() method returns a promise which resolves once the queue has been sucessfully subscribed to.

hipchatwebqueue's People

Contributors

edamtoft avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.