-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making this an actual update and adding missing build targets
- Loading branch information
Patrick Webster
committed
Aug 26, 2019
1 parent
96a25cd
commit 0956699
Showing
5 changed files
with
93 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"name": "pg_amqp", | ||
"abstract": "AMQP protocol support for PostgreSQL", | ||
"version": "0.4.2", | ||
"version": "0.5.0", | ||
"description": "The pg_amqp package provides the ability for postgres statements to directly publish messages to an AMQP broker.", | ||
"maintainer": | ||
[ "Theo Schlossnagle <[email protected]>", "Keith Fiske <[email protected]" ] | ||
"maintainer": | ||
[ "Theo Schlossnagle <[email protected]>", "Keith Fiske <[email protected]" ] | ||
"license": [ "bsd", "mozilla_1_0" ], | ||
"generated_by": "Keith Fiske", | ||
"status": "stable", | ||
|
@@ -19,7 +19,7 @@ | |
"amqp": { | ||
"file": "sql/amqp--0.4.1.sql", | ||
"docfile": "doc/amqp.md", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"abstract": "AMQP protocol support for PostgreSQL" | ||
} | ||
}, | ||
|
@@ -32,7 +32,7 @@ | |
"web": "https://github.com/omniti-labs/pg_amqp", | ||
"type": "git" | ||
} | ||
}, | ||
}, | ||
|
||
"meta-spec": { | ||
"version": "1.0.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# amqp extension | ||
comment = 'AMQP protocol support for PostgreSQL' | ||
default_version = '0.4.2' | ||
default_version = '0.5.0' | ||
module_pathname = '$libdir/pg_amqp' | ||
relocatable = false | ||
schema = amqp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
CREATE TABLE @[email protected] ( | ||
broker_id serial NOT NULL, | ||
host text NOT NULL, | ||
port integer NOT NULL DEFAULT 5672, | ||
vhost text, | ||
username text, | ||
password text, | ||
PRIMARY KEY (broker_id, host, port) | ||
); | ||
|
||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]', ''); | ||
SELECT pg_catalog.pg_extension_config_dump('@[email protected]_broker_id_seq', ''); | ||
|
||
CREATE FUNCTION @[email protected]_publish( | ||
broker_id integer | ||
, exchange varchar | ||
, routing_key varchar | ||
, message varchar | ||
, delivery_mode integer default null | ||
, content_type varchar default null | ||
, reply_to varchar default null | ||
, correlation_id varchar default null | ||
) | ||
|
||
RETURNS boolean AS 'pg_amqp.so', 'pg_amqp_autonomous_publish' | ||
LANGUAGE C IMMUTABLE; | ||
|
||
COMMENT ON FUNCTION @[email protected]_publish(integer, varchar, varchar, varchar, integer, varchar, varchar, varchar) IS | ||
'Works as amqp.publish does, but the message is published immediately irrespective of the | ||
current transaction state. PostgreSQL commit and rollback at a later point will have no | ||
effect on this message being sent to AMQP.'; | ||
|
||
|
||
CREATE FUNCTION amqp.disconnect(broker_id integer) | ||
RETURNS void AS 'pg_amqp.so', 'pg_amqp_disconnect' | ||
LANGUAGE C IMMUTABLE STRICT; | ||
|
||
COMMENT ON FUNCTION amqp.disconnect(integer) IS | ||
'Explicitly disconnect the specified (broker_id) if it is current connected. Broker | ||
connections, once established, live until the PostgreSQL backend terminated. This | ||
allows for more precise control over that. | ||
select amqp.disconnect(broker_id) from amqp.broker | ||
will disconnect any brokers that may be connected.'; | ||
|
||
|
||
CREATE FUNCTION amqp.exchange_declare( | ||
broker_id integer | ||
, exchange varchar | ||
, exchange_type varchar | ||
, passive boolean | ||
, durable boolean | ||
, auto_delete boolean DEFAULT false | ||
) | ||
RETURNS boolean AS 'pg_amqp.so', 'pg_amqp_exchange_declare' | ||
LANGUAGE C IMMUTABLE; | ||
|
||
COMMENT ON FUNCTION amqp.exchange_declare(integer, varchar, varchar, boolean, boolean, boolean) IS | ||
'Declares a exchange (broker_id, exchange_name, exchange_type, passive, durable, auto_delete) | ||
auto_delete should be set to false (default) as unexpected errors can cause disconnect/reconnect which | ||
would trigger the auto deletion of the exchange.'; | ||
|
||
|
||
CREATE FUNCTION @[email protected]( | ||
broker_id integer | ||
, exchange varchar | ||
, routing_key varchar | ||
, message varchar | ||
, delivery_mode integer default null | ||
, content_type varchar default null | ||
, reply_to varchar default null | ||
, correlation_id varchar default null | ||
) | ||
RETURNS boolean AS 'pg_amqp.so', 'pg_amqp_publish' | ||
LANGUAGE C IMMUTABLE; | ||
|
||
COMMENT ON FUNCTION @[email protected](integer, varchar, varchar, varchar, integer, varchar, varchar, varchar) IS | ||
'Publishes a message (broker_id, exchange, routing_key, message). | ||
The message will only be published if the containing PostgreSQL transaction successfully commits. | ||
Under certain circumstances, the AMQP commit might fail. In this case, a WARNING is emitted. | ||
The last four parameters are optional and set the following message properties: | ||
delivery_mode (either 1 or 2), content_type, reply_to and correlation_id. | ||
Publish returns a boolean indicating if the publish command was successful. Note that as | ||
AMQP publish is asynchronous, you may find out later it was unsuccessful.'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- NOTE: No changes to sql extension code contained in this update. Only C code has been patched, so a "make install" must be run to apply the library updates. You must also still run "ALTER EXTENSION amqp UPDATE' to update the extension version number in the database. |