• Stars
    star
    227
  • Rank 170,184 (Top 4 %)
  • Language
    Erlang
  • Created almost 15 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Experimental RabbitMQ PubSubHubBub interface

PubSub-over-Webhooks with RabbitHub

RabbitHub is an implementation of PubSubHubBub, a straightforward pubsub layer on top of plain old HTTP POST - pubsub over Webhooks. RabbitHub provides an HTTP-based interface to RabbitMQ.

It gives every AMQP exchange and queue hosted by a RabbitMQ broker a couple of URLs: one to use for delivering messages to the exchange or queue, and one to use to subscribe to messages forwarded on by the exchange or queue. You subscribe with a callback URL, so when messages arrive, RabbitHub POSTs them on to your callback. For example,

The symmetrical .../subscribe/x/... and .../endpoint/q/... also exist.

The PubSubHubBub protocol specifies some RESTful(ish) operations for establishing subscriptions between message sources (a.k.a "topics") and message sinks. RabbitHub implements these operations as well as a few more for RESTfully creating and deleting exchanges and queues.

While PubSubHubBub is written assuming Atom content, RabbitHub is content-agnostic (just like RabbitMQ): any content at all can be sent using RabbitHub's implementation of the PubSubHubBub protocol. Because RabbitHub is content-agnostic, it doesn't implement any of the Atom-specific parts of the PubSubHubBub protocol, including the "ping" operation that tells a PSHB hub to re-fetch content feeds.

Example: combining HTTP messaging with AMQP and XMPP

Combining RabbitHub with the AMQP protocol implemented by RabbitMQ itself and with the other adapters and gateways that form part of the RabbitMQ universe lets you send messages across different kinds of message networks - for example, our public RabbitMQ instance, dev.rabbitmq.com, has RabbitHub running as well as the standard AMQP adapter, the rabbitmq-xmpp plugin, and a bunch of our other experimental stuff, so you can do things like this:

RabbitHub example configuration

  • become XMPP friends with [email protected] (the XMPP adapter gives each exchange a JID of its own)

  • use PubSubHubBub to subscribe the sink http://dev.rabbitmq.com/rabbithub/endpoint/x/pshb to some PubSubHubBub source - perhaps one on the public Google PSHB instance. (Note how the given URL ends in "x/pshb", meaning the "pshb" exchange - which lines up with the JID we just became XMPP friends with.)

  • wait for changes to be signalled by Google's PSHB hub to RabbitHub

  • when they are, you get an XMPP IM from [email protected] with the Atom XML that the hub sent out as the body

Again, RabbitHub is content-agnostic, so the fact that Atom appears is an artifact of what Google's public PSHB instance is mailing out, rather than anything intrinsic in pubsub-over-webhooks.

Installation

To install from source (requires Erlang R15B01 or higher):

git clone https://github.com/brc859844/rabbithub
cd rabbithub
make deps
make
make package
cp dist/*.ez $RABBITMQ_HOME/plugins

Note that Windows users can build the plugin using the commands under Cygwin. When working with Cygwin ensure that the Erlang bin directory is in your PATH (so that rebar can find erl and erlc) and that the zip utility is installed with your Cygwin installation (required to create the plugin ez file).

Enable the plugin:

rabbitmq-plugins enable rabbithub

By default the plugin will listen for HTTP requests on port 15670.

Note that if no username is specified for HTTP requests submitted to RabbitHub then RabbitHub checks to see whether a default username has been specified for the rabbithub application, and if so uses it. By default RabbitHub is configured to use a default username of guest (see the definition of default_username in rabbithub.app). This configuration might be reasonable for development and testing (aside from security testing); however for production environments this will most likely not be ideal, and the default username should therefore be deleted or changed to a RabbitMQ username that has only the required permissions. It is generally also a good idea to disable the RabbitMQ guest user, or to at least reduce the permissions of guest (when RabbitMQ is initially installed, the username guest has full permissions and a rather well-known password).

HTTP messaging in the Browser

In order to push AMQP messages out to a webpage running in a browser, try using http://www.reversehttp.net/ to run a PubSubHubBub endpoint in a webpage - see for instance http://www.reversehttp.net/demos/endpoint.html and its associated Javascript for a simple prototype of the idea. It's also possible to build simple PSHB hubs in Javascript using the same tools.

Proxy server support

If RabbitHub is being used behind a firewall, it may be necessary to route HTTP(s) requests to callback URLs via a proxy server. A proxy server can be specified for RabbitHub by defining http_client_options in rabbitmq.config as illustrated below, where the same proxy server has been specified for both HTTP and HTTPS, and the proxy server will not be used for requests to localhost.

[
    {rabbithub, [
        {http_client_options, [
            {proxy,{{"10.1.1.1",8080}, ["localhost"]}},
            {https_proxy,{{"10.1.1.1",8080},["localhost"]}}
        ]}
    ]}
].

Note that proxy server support is only available in RabbitHub for RabbitMQ 3.2.1 or higher.

Software License

RabbitHub is open-source code, licensed under the very liberal MIT license:

Copyright (c) 2009 Tony Garnock-Jones <[email protected]>
Copyright (c) 2009 LShift Ltd. <[email protected]>

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.

More Repositories

1

js-nacl

Pure-Javascript High-level API to Emscripten-compiled libsodium routines.
JavaScript
491
star
2

reversehttp

A dynamic, ReST-style means of enrolment and participation in an HTTP network; a dynamically-configurable "Remote CGI" service. Joining the World Wide Web as an HTTP server has been an ad-hoc, manual process. By using the protocol defined here, programs can provide services to the Web just as easily as they request services from the Web.
Java
220
star
3

js-scrypt

Emscripten-compiled Javascript version of scrypt, a high-quality password-based key derivation function.
JavaScript
164
star
4

syndicate

synΒ·diΒ·cate: a language for interactive programs
Racket
148
star
5

erlang-rfc4627

Erlang RFC4627 (JSON) codec and JSON-RPC server implementation.
Erlang
121
star
6

pi-nothing

i386, x86_64, ARMv7 assembler/linker; Nothing-like mid-level language; Linear-scan register allocator; Operating system for Raspberry Pi
Racket
99
star
7

erlang-serial

Erlang serial-port support; based on serial-1.0 by Johan Bevemyr
C
89
star
8

rabbiter

Microblogging using RabbitMQ and ejabberd
Erlang
76
star
9

marketplace

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/marketplace-2014
73
star
10

rmacs

An EMACS written in Racket. Runs in ANSI-compatible terminals.
Racket
72
star
11

racket-reloadable

Support for code-reloading for long-running racket programs (such as web-servers).
Racket
60
star
12

python-rfc3339

Implementation of the majority of RFC 3339 for python.
Python
55
star
13

udp-exchange

Extends RabbitMQ Server with support for a new experimental exchange type, `x-udp`.
Erlang
50
star
14

synchrotron

A Javascript JSON DVCS underpinning a Smalltalk-like image holding code & data in a single HTML file. A bit like Tiddlywiki. Work in progress. Also, little modules for diff, diff3, and merge of text etc.
HTML
42
star
15

script-exchange

RabbitMQ "Script Exchange" plugin
Erlang
41
star
16

racket-rfc6455

RFC 6455 WebSockets support for Racket.
Racket
40
star
17

racket-something

Indentation-based Racket Syntax
Racket
37
star
18

erlang-smtp

Erlang SMTP and POP3 server code.
Erlang
35
star
19

kali-scheme

Kali is Kelsey and Rees's distributed Scheme implementation based on Scheme48
Scheme
34
star
20

presence-exchange

An experimental RabbitMQ "Presence" exchange: notifies bound queues when other bindings appear and disappear
Java
32
star
21

racket-explorer

Utility for interactive exploration of complex data structures.
Racket
32
star
22

3-move

a multi-user networked online text-based programmable virtual environment
C
31
star
23

racket-bitsyntax

Erlang-style binaries/bitstrings for Racket
Racket
31
star
24

erlang-scrypt

Erlang port driver for Colin Percival's "scrypt" function.
C
25
star
25

erlang-ircd

A pluggable IRC daemon application/library for Erlang.
Erlang
23
star
26

js-vau

Kernel-like interpreter
JavaScript
22
star
27

camstream

Camstream uses AMQP to route live, streaming video from one or more webcams to one or more displays.
Java
22
star
28

racket-monad

Monads for Racket (!)
Racket
21
star
29

revctrl.org

An extract, as complete as I can make it, of content from the revctrl.org wiki
Python
21
star
30

racket-ansi

ANSI and VT10x escape sequences for Racket.
Racket
18
star
31

rabbitmq-xmpp

RabbitMQ XMPP gateway
Erlang
16
star
32

erlang-nacl

Erlang binding to NaCl in the form of libsodium.
C
15
star
33

squeaker

Like Docker, but for Squeak. You know, for kids.
Python
14
star
34

racket-packet-socket

Access to raw Ethernet frames from Racket
Racket
14
star
35

racket-operational-transformation

Implements Operational Transformation (OT) for Racket.
Racket
14
star
36

racket-nat-traversal

Racket implementation of NAT traversal utilities for opening ports on home routers.
Racket
13
star
37

racket-reloadable-example

A simple website written with the Racket webserver, supporting runtime code-reloading.
Racket
12
star
38

ocaml-networking

Network server programming with OCaml
OCaml
12
star
39

squeak-actors

Erlang-style Actors for Squeak. http://tonyg.github.io/squeak-actors/
CSS
12
star
40

racket-stomp

An implementation of the STOMP 1.1 protocol (client) for Racket
Racket
12
star
41

minimart

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/minimart-2014
11
star
42

smlnj-networking

Network server programming with SML/NJ and CML
Standard ML
11
star
43

stoj

A join-calculus-based programming language for exploring description, simulation, and visualization of biochemical systems modelled as concurrent, rate-limited processes.
Java
10
star
44

rust-scheme

I am teaching myself Rust by failing a lot.
Rust
9
star
45

newmoon

A naΓ―ve continuation-passing-style-transform based compiler for a language asymptotically approaching R5RS Scheme.
Scheme
9
star
46

prex

Prex is an open source, royalty-free, real-time operating system for embedded systems.
C
8
star
47

delta-t-udp

Experiments in constructing a Delta-t-like protocol atop UDP.
8
star
48

python-supercollider

Communicate with the Supercollider server using python instead of the language and GUI
Python
8
star
49

hop

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/hop-2012
7
star
50

racl

Racket bindings for nacl.cr.yp.to
Racket
7
star
51

streaming-bt

Experiments in N-way queue replication
Erlang
7
star
52

racket-unix-signals

Sending and handling Unix signals from Racket
Racket
7
star
53

racketmq

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/racketmq-2017
7
star
54

erlang-xmpp-component

XMPP Component Protocol (XEP-0114) Library for Erlang
Erlang
7
star
55

js-marketplace

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/js-marketplace-2014
7
star
56

racket-auxiliary-macro-context

Syntactic extensibility outside expressions.
Racket
6
star
57

marketplace-dns

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/marketplace-dns-2014
6
star
58

webcam-snapshot-osx

Java Quicktime code for grabbing frames off a webcam on OS X
Java
6
star
59

texpict.rkt

Embed LaTeX snippets in picts for e.g. slideshow usage
Racket
6
star
60

erlang-openmoko

Erlang Openmoko userland replacement for gsmd/frameworkd/dialer/sms/addressbook etc.
Erlang
6
star
61

multicast-sync-experiments

Experiments in using multicasting to synchronise participants in a distributed topic
Erlang
5
star
62

xcb-shim

Intermediate form of XCB protocol specification data structures, to make it easier to build native bindings rather than wrapping libxcb
Python
5
star
63

passthru

TCP proxy tool for getting a (hex) dump of everything that passes by. Useful for protocol analysis and debugging.
C
5
star
64

erlang-jukebox

An Erlang Jukebox server
Python
5
star
65

racket-effects

Delimited-continuation-based effects for Racket
Racket
5
star
66

rais

C
5
star
67

scheme-httpd

A simple HTTP daemon, written in R5RSish Scheme
Scheme
5
star
68

stomp

A ruby gem for sending and receiving messages from a Stomp protocol compliant message queue.
Ruby
5
star
69

racket-abnf

ABNF parser implementation #lang for Racket.
Racket
5
star
70

minimart-netstack

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/minimart-netstack-2014
5
star
71

racket-font

First-principles font rendering for Racket
Racket
5
star
72

marketplace-ssh

Repository has moved: https://git.syndicate-lang.org/syndicate-lang/marketplace-ssh-2014
5
star
73

pyle2

A python WikiClone
Python
4
star
74

racket-dbus

Native D-Bus Client For Racket
Racket
4
star
75

barebones-android

Scavenging a kernel, initramfs, and recovery tooling from a Cyanogenmod installation, and using them to make a horrible Frankenstein's monster.
C
4
star
76

rabbitmq-universe

Scripts for building packages for RabbitMQ server and plugins
Python
4
star
77

racket-timers

Timer event utilities that integrate well with (sync).
Racket
4
star
78

gst-cairo-widgets

A widget library for GNU Smalltalk built on SDL and Cairo
Smalltalk
4
star
79

racket-opencv-videocapture

Simple FFI binding to opencv video capture routines from Racket
Racket
4
star
80

mixfix

A mixfix parsing system after Danielsson and Norell 2008
Racket
4
star
81

racket-content-defined-chunking

Content-Defined Chunking, after rsync / Rabin fingerprinting / FastCDC / Ronomon's algorithm.
Racket
4
star
82

cl-match

NOTE: SUPERSEDED BY OPTIMA, https://github.com/m2ym/optima. Bug fixes for Daniel S. Bensen's CL-MATCH common-lisp pattern matching library
Common Lisp
4
star
83

json-shapes

Schema validation and other goodies for JSON data
JavaScript
4
star
84

racket-google

Google APIs (Drive, Plus, ...) for Racket.
Racket
4
star
85

racket-camstream

A Racket camdisplay implementation compatible with the original.
Racket
3
star
86

racket-send-exp

Terse syntax for object-oriented message sending
Racket
3
star
87

ohm-ecmascript-extension-example

Example demonstrating syntactic extension of ES5 using Ohm.
JavaScript
3
star
88

racket-struct-defaults

Default values in struct ctors and patterns.
Racket
3
star
89

racket-pkg-server

Racket package catalog server setup scripts and ops documentation
Shell
3
star
90

racket-inverted-index

Playing around with inverted indexing for Racket
Racket
3
star
91

racket-ohm

An Ohm-style parsing package.
Racket
3
star
92

racket-salty-crypto

libsodium and libb2 bindings for Racket, plus an implementation of the Noise Protocol Framework
Racket
3
star
93

pgg

The PGG system is Peter Thiemann's partial evaluation system for the programming language Scheme.
Scheme
3
star
94

racket-critbit

Critbit trees in Racket
Racket
3
star
95

racket-portaudio

FFI bindings to PortAudio, http://portaudio.com/
Racket
3
star
96

racket-opus

FFI bindings to Opus, http://www.opus-codec.org/
Racket
3
star
97

js-voice

Audio-processing libraries for Javascript suitable for simple VOIPish applications
JavaScript
3
star
98

racket-scrypt

Racket binding to Colin Percival's "scrypt" function.
Racket
3
star
99

gyre

A simple CMS, usable as a blog or wiki.
Python
3
star
100

racket-logbook

Logbook: keep track of your experiments
Racket
2
star