Skip to content

Commit

Permalink
Add build instructions; convert to Markdown.
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed May 19, 2011
1 parent 98487df commit fa70c24
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,49 @@
pg_amqp 0.2.0
=============

The pg_amqp package provides the ability for postgres statements to directly
publish messages to an AMQP broker.
publish messages to an [AMQP](http://www.amqp.org/) broker.

To build pg_amqp, just do this:

make
make install

If you encounter an error such as:

"Makefile", line 8: Need an operator

You need to use GNU make, which may well be installed on your system as
`gmake`:

gmake
gmake install

If you encounter an error such as:

make: pg_config: Command not found

Be sure that you have `pg_config` installed and in your path. If you used a
package management system such as RPM to install PostgreSQL, be sure that the
`-devel` package is also installed. If necessary tell the build process where
to find it:

env PG_CONFIG=/path/to/pg_config make && make install

Usage:
Usage
-----

Insert AMQP broker information (host/port/user/pass) into the
amqp.broker table.
`amqp.broker` table.

A process starts and connects to PostgreSQL and runs:

select amqp.publish(broker_id, "amqp.direct", "foo", "message");
SELECT amqp.publish(broker_id, 'amqp.direct', 'foo', 'message');

Upon process termination, all broker connections will be torn down.
If there is a need to disconnect from a specific broker, one can call:

select amqp.disconnect(broker_id);
select amqp.disconnect(broker_id);

which will disconnect from the broker if it is connected and do nothing
if it is already disconnected.
Expand Down

0 comments on commit fa70c24

Please sign in to comment.