• Stars
    star
    203
  • Rank 192,890 (Top 4 %)
  • Language
    C
  • Created over 13 years ago
  • Updated 5 months ago

Reviews

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

Repository Details

AMQP Support for Postgres

pg_amqp

The pg_amqp package provides the ability for postgres statements to directly publish messages to an AMQP broker.

All bug reports, feature requests and general questions can be directed to the Issues section on Github. - http://github.com/omniti-labs/pg_amqp

Building

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

Some prepackaged Mac installs of postgres might need a little coaxing with modern XCodes. If you encounter an error such as:

make: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc: No such file or directory

Then you'll need to link the toolchain

sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain

And if you encounter an error about a missing /usr/bin/postgres:

ld: file not found: /usr/bin/postgres

You might need to link in your real postgres:

sudo ln -s /usr/bin/postgres_real /usr/bin/postgres

Loading

Once amqp is installed, you can add it to a database. Add this line to your postgresql config

shared_preload_libraries = 'pg_amqp.so'

This extension requires PostgreSQL 9.1.0 or greater, so loading amqp is as simple as connecting to a database as a super user and running

CREATE EXTENSION amqp;

If you've upgraded your cluster to PostgreSQL 9.1 and already had amqp installed, you can upgrade it to a properly packaged extension with:

CREATE EXTENSION amqp FROM unpackaged;

This is required to update to any versions >= 0.4.0.

To update to the latest version, run the following command after running "make install" again:

ALTER EXTENSION amqp UPDATE;

Basic Usage

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

A process starts and connects to PostgreSQL and runs:

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);

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

More Repositories

1

jsend

JSend is a specification for a simple, no-frills, JSON based format for application-level communication.
1,468
star
2

omnipitr

Advanced WAL File Management Tools for PostgreSQL
Perl
177
star
3

pg_jobmon

PostgreSQL extension which provides persistent logging within transactions and functions.
PLpgSQL
168
star
4

pg_extractor

PG Extractor - Advanced PostgreSQL Dump Filter
Python
161
star
5

pgtreats

Tasty treats for PostgreSQL
Perl
111
star
6

ansible-dk

An omnibus-based toolkit for working on Ansible-based infrastructure code.
Ruby
85
star
7

mimeo

Extension for specialized, per-table replication between PostgreSQL instances
PLpgSQL
78
star
8

jlog

JLog - Journaled Log
C
53
star
9

zetaback

Zetaback is a thin-agent based ZFS backup tool. It is designed to help simplify the task of backing up thousands of filesystems on hundreds of machines across and organization. It simplifies the task of automatically picking up newly created ZFS filesystems for backup purposes and restoring any given backup (host/FS/timestamp) to a target ZFS capable host.
Perl
39
star
10

omnios-build

Build system for OmniOS - Note, this is a quasi-private archive for OmniTI, you probably want https://omniosce.org
Shell
39
star
11

curo

postgres command-line tools
Shell
38
star
12

portableumem

This is a port of the Solaris umem memory allocator to other popular operating systems, such as Linux, Windows and BSDish systems (including Darwin/OSX).
C
30
star
13

Net--RabbitMQ

Perl bindings to the librabbitmq-c AMQP library.
C
25
star
14

resmon

Resmon is a lightweight utility for local host monitoring that can be queried by tools such as nagios over http. One of the main design goals is portability: that resmon should require nothing more than a default install of Perl. Built with the philosophy that "we are smart because we are dumb," that is, local requirements should be minimal to ease deployment on multiple platforms.
Perl
25
star
15

pg_query_statsd

Send query statistics to statsd
C
19
star
16

chef-solo-helper

Helper scripts for running chef-solo with a git backed repository
Shell
16
star
17

system_monitoring

Script for system monitoring
Perl
13
star
18

circus2

Various helper tools making use of the circonus v2 api
Python
6
star
19

db-failover

Postgres Failover Script
Perl
6
star
20

kayak

Kayak (PXE-enabled network imaging of OmniOS) - Note, this is a quasi-private archive for OmniTI, you probably want https://omniosce.org
Shell
6
star
21

circus

Python API client app and library for Circonus v1 API
Python
5
star
22

pgbrew

Pg Brew
Shell
4
star
23

pgOtter

PostgreSQL query log analyzer
Perl
4
star
24

svr42pkgsrc

SVR4 to pkgsrc conversion tools.
Shell
4
star
25

omnifab

Library of useful helper functions for fabric
Python
3
star
26

template-maker

Script to help automate the creation of configuration management templates from raw configuration files
Python
2
star
27

spreadlogd

Spreadlogd is a simple tool to log messages received via the Spread Group Communication system. It is primary used in conjuction with mod_log_spread to journal a centralized log file for a cluster of Apache servers.
C
2
star
28

chef-sudo

Cookbook to manage sudoers file
Ruby
1
star
29

revealjs_omniti_template

Template for creating OmniTI reveal.js themed presentations
JavaScript
1
star
30

openssh-securid

OpenSSH with SecurID integration
1
star
31

omniti-ms

OmniTI OmniOS package repo build scripts
Shell
1
star
32

mungo-PSGI

Perl
1
star