Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
Update README with Rabbit message
Browse files Browse the repository at this point in the history
  • Loading branch information
j0k3r committed Sep 21, 2016
1 parent 17de24c commit 8064f51
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ The general idea is to push any inserted / updated / deleted document in Postgre

- [Multicorn](http://multicorn.org/) 1.3.x and up
- Python 2.7 (Don't know if Python 3 works)
- A RabbitMQ server
- A RabbitMQ server (with exchange and queue configured)
- A PostgreSQL server (tested under 9.5, should be fine with 9.3 & 9.4 too)
- Be sure to have these packages installed (at least on Ubuntu): `make gcc git postgresql-server-dev-9.5 python-dev python-setuptools python-pip`

## Installation

```bash
git clone https://github.com/Kozea/Multicorn /tmp/multicorn
cd $_
cd /tmp/multicorn
git checkout v1.3.2
make install

git clone https://github.com/20minutes/pg-rabbitmq-fdw /tmp/pg-rabbitmq-fdw
cd $_
cd /tmp/pg-rabbitmq-fdw
pip install -r requirements.txt
python setup.py install
```
Expand Down Expand Up @@ -105,3 +105,37 @@ CREATE TRIGGER rabbitmq_delete_tag
BEFORE DELETE ON tag
FOR EACH ROW EXECUTE PROCEDURE delete_tag();
```

## Message in RabbitMQ

Here are some sample of message pushed in RabbitMQ.

For an insert:

```json
{
"action": "insert",
"table": "tag",
"id": "c9cd5011-400a-4b06-bcc4-2e4eb62e6d87"
}
```

For an update:

```json
{
"action": "update",
"table": "tag",
"id": "c9cd5011-400a-4b06-bcc4-2e4eb62e6d87"
}
```

For a delete:

```json
{
"action": "delete",
"table": "tag",
"id": "c9cd5011-400a-4b06-bcc4-2e4eb62e6d87"
}
```

0 comments on commit 8064f51

Please sign in to comment.