A Storm topology to stream data from RabbitMQ to Redshift/Postgres.
To get psycopg2 to work, install the following packages (Ubuntu):
sudo apt-get install libpq-dev python-dev
Now, install the required packages (in a virtualenv preferably):
pip install -r virtualenvs/requirements.txt
Run the sql file schema/tables.sql
against your database to create the tables
necessary for running this example.
Make sure to set the environment variables for your db instance (RS_DBNAME
,
RS_HOST
, RS_PORT
, RS_USER
, RS_PASS
) as well as your RabbitMQ instance
(RABBITMQ_SCHEME
). It will connect to your local instance (if any) by default.
To run the topology in your local machine, do:
cd rabbitmq-redshift-streamer
sparse run
To submit the topology to a production cluster, do:
sparse submit
To see the topology in action, feed data to a RabbitMQ queue users
as json:
{"id": "<user-id>", "name": "<user-name>"}