True to it's name, SubPub is a system-to-system messaging solution designed to be a "black box", hiding as much as possible the complexity inherent in messaging. It's design goals are:
- Interoperability
- Ease of use / low barrier to adoption
- Standard messaging stereotype (Pub/Sub, Request/Reply)
- "Always On" architecture
In short, events are published into SubPub to which multiple consumers may subscribe to, for which SubPub guarantees at least once delivery. SubPub services wrap two sides (publishing and delivery) of the RabbitMQ AMQP messaging broker. On the front-end/publishing side is an HTTP RESTful endpoint that allows a Principal to manage subscriptions and publish messages. The back-end/delivery side manages several processes which consume messages from the AMQP broker and delivers them to Consumer Endpoints. Consumer Endpoints are typically RESTful services.
Installing pre-requisites
Erlang will need to be installed locally. On OS X, it's as simple as
brew install erlang
Alternatively, you could download and install from source:
wget http://www.erlang.org/download/otp_src_R15B01.tar.gz
tar zxvf otp_src_R15B01.tar.gz
cd otp_src_R15B01
./configure
make
sudo make install
SubPub utilizes RabbitMQ internally as it's message broker. You will need to
[download/install] (http://www.rabbitmq.com/download.html) from VMWare.
If you are on OS X, Homebrew is the easiest way to get up and running.
brew update
brew install rabbitmq
And if you're installing from source:
wget http://www.rabbitmq.com/releases/rabbitmq-server/v2.8.1/rabbitmq-server_2.8.1-1_all.deb
sudo dpkg -i --force-depends rabbitmq-server_2.8.1-1_all.deb
sudo rabbitmq-plugins enable rabbitmq_management
sudo /etc/init.d/rabbitmq-server restart
Let's get 'er running...
export ERL_LIBS="deps/erlang:$ERL_LIBS"
./rebar clean compile
Ensure that RabbitMQ is running locally and can accept connections from subpub. Typically, you start via:
rabbitmq-server
And fire up subpub:
./shell
Assuming all goes well, you can check your local subpub service at [the status link] (http://localhost:4778/v1/status).
It should show something like this:
{
"status": {
"served_by": "[email protected]",
"current_time": "2012-08-24T14:55:01Z",
"up_nodes": [
{
"node": {
"name": "[email protected]",
"version": "r3",
"start_time": "2012-08-24T14:53:43Z",
"uptime_seconds": 78,
"num_messages_posted": 0,
"num_messages_delivered": 0,
"num_failed_deliveries": 0,
"num_watched_subscriptions": 0,
"rest_status": "serverin",
"watched_subscriptions": [],
"processes_awaiting_broker_reconnection": []
}
}
],
"down_nodes": []
}
}
Licensed under Apache 2.0. See LICENSE file.