summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Wragg <david@rabbitmq.com>2010-09-03 10:20:49 +0100
committerDavid Wragg <david@rabbitmq.com>2010-09-03 10:20:49 +0100
commit5b41470ca661d528dbafadb5865eaaa2a4342c21 (patch)
tree6d528245ee1254f1dc1204298230f86bf3b872a2
parent2c294abfe4f50345d05bae6985b619ccdfedc70d (diff)
parentb85fa81a4076536048ea374094dccbd580a5fe6e (diff)
downloadrabbitmq-c-github-ask-5b41470ca661d528dbafadb5865eaaa2a4342c21.tar.gz
Merge bug22951 into default (Make the C client on default use 0-9-1)
-rw-r--r--README33
-rw-r--r--configure.ac2
-rw-r--r--examples/amqp_consumer.c2
-rw-r--r--examples/amqp_exchange_declare.c2
-rw-r--r--examples/amqp_listen.c2
-rw-r--r--examples/amqp_listenq.c2
-rw-r--r--librabbitmq/amqp.h6
-rw-r--r--librabbitmq/amqp_api.c12
-rw-r--r--librabbitmq/amqp_socket.c8
-rw-r--r--librabbitmq/codegen.py1
-rw-r--r--tools/consume.c2
11 files changed, 23 insertions, 49 deletions
diff --git a/README b/README
index 3d68ad1..6ae88dc 100644
--- a/README
+++ b/README
@@ -3,22 +3,17 @@
## Introduction
This is a C-language AMQP client library for use with AMQP servers
-speaking protocol versions 0-8 and 0-9-1.
+speaking protocol versions 0-9-1.
- <http://www.rabbitmq.com/>
- <http://www.amqp.org/>
- <http://hg.rabbitmq.com/rabbitmq-c>
-*NB*: This library's source code supports *either* 0-8 *or* 0-9-1, not
-both simultaneously. Please check carefully that you have the variant
-you require.
-
Announcements regarding the library are periodically made on the
-RabbitMQ mailing list and on LShift's blog.
+RabbitMQ mailing list and on the RabbitMQ blog.
- <http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss>
- - <http://www.lshift.net/blog/>
- - <http://www.lshift.net/blog/category/lshift-sw/rabbitmq/>
+ - <http://www.rabbitmq.com/blog/>
## Retrieving the code
@@ -91,25 +86,3 @@ access an AMQP connection or any of its channels from more than one
thread, it is entirely responsible for designing and implementing an
appropriate locking scheme. It will generally be much simpler to have
a connection exclusive to each thread that needs AMQP service.
-
-### Switching the codebase to the 0-9-1 protocol version
-
-In current releases, the default (trunk) branch of the mercurial
-repository hosting the `rabbitmq-c` code is set up for AMQP 0-8
-support, with AMQP 0-9-1 support living on a separate mercurial
-branch.
-
-NOTE: Protocol versions 0-8 and 0-9-1 are incompatible on the
-wire. You cannot use a client library that speaks one protocol version
-to communication with a server that speaks the other.
-
-To switch your checked-out copy of the source code to 0-9-1
-support,
-
- (cd rabbitmq-codegen; hg up amqp_0_9_1)
- (cd rabbitmq-c; hg up amqp_0_9_1)
-
-before building the code. If you switch branches after having compiled
-the code, make sure to rerun `autoreconf`, `configure`, `make clean`
-and `make` after switching branches.
-
diff --git a/configure.ac b/configure.ac
index 904d4ef..be7e695 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,7 +51,7 @@ AC_ARG_ENABLE(64-bit,
AC_MSG_CHECKING(location of AMQP codegen directory)
sibling_codegen_dir="$ac_abs_confdir/../rabbitmq-codegen"
AMQP_CODEGEN_DIR=$(test -d "$sibling_codegen_dir" && echo "$sibling_codegen_dir" || echo "$ac_abs_confdir/codegen")
-AMQP_SPEC_JSON_PATH="$AMQP_CODEGEN_DIR/amqp-rabbitmq-0.8.json"
+AMQP_SPEC_JSON_PATH="$AMQP_CODEGEN_DIR/amqp-rabbitmq-0.9.1.json"
if test -f "$AMQP_SPEC_JSON_PATH"
then
diff --git a/examples/amqp_consumer.c b/examples/amqp_consumer.c
index 803e228..b1754f5 100644
--- a/examples/amqp_consumer.c
+++ b/examples/amqp_consumer.c
@@ -177,7 +177,7 @@ int main(int argc, char const * const *argv) {
AMQP_EMPTY_TABLE);
die_on_amqp_error(amqp_get_rpc_reply(conn), "Binding queue");
- amqp_basic_consume(conn, 1, queuename, AMQP_EMPTY_BYTES, 0, 1, 0);
+ amqp_basic_consume(conn, 1, queuename, AMQP_EMPTY_BYTES, 0, 1, 0, AMQP_EMPTY_TABLE);
die_on_amqp_error(amqp_get_rpc_reply(conn), "Consuming");
run(conn);
diff --git a/examples/amqp_exchange_declare.c b/examples/amqp_exchange_declare.c
index 27bff1a..e77ac52 100644
--- a/examples/amqp_exchange_declare.c
+++ b/examples/amqp_exchange_declare.c
@@ -89,7 +89,7 @@ int main(int argc, char const * const *argv) {
die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel");
amqp_exchange_declare(conn, 1, amqp_cstring_bytes(exchange), amqp_cstring_bytes(exchangetype),
- 0, 0, 0, AMQP_EMPTY_TABLE);
+ 0, 0, AMQP_EMPTY_TABLE);
die_on_amqp_error(amqp_get_rpc_reply(conn), "Declaring exchange");
die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel");
diff --git a/examples/amqp_listen.c b/examples/amqp_listen.c
index 3e56008..f208652 100644
--- a/examples/amqp_listen.c
+++ b/examples/amqp_listen.c
@@ -109,7 +109,7 @@ int main(int argc, char const * const *argv) {
AMQP_EMPTY_TABLE);
die_on_amqp_error(amqp_get_rpc_reply(conn), "Binding queue");
- amqp_basic_consume(conn, 1, queuename, AMQP_EMPTY_BYTES, 0, 1, 0);
+ amqp_basic_consume(conn, 1, queuename, AMQP_EMPTY_BYTES, 0, 1, 0, AMQP_EMPTY_TABLE);
die_on_amqp_error(amqp_get_rpc_reply(conn), "Consuming");
{
diff --git a/examples/amqp_listenq.c b/examples/amqp_listenq.c
index 0fbce51..98c389f 100644
--- a/examples/amqp_listenq.c
+++ b/examples/amqp_listenq.c
@@ -90,7 +90,7 @@ int main(int argc, char const * const *argv) {
amqp_channel_open(conn, 1);
die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel");
- amqp_basic_consume(conn, 1, amqp_cstring_bytes(queuename), AMQP_EMPTY_BYTES, 0, 0, 0);
+ amqp_basic_consume(conn, 1, amqp_cstring_bytes(queuename), AMQP_EMPTY_BYTES, 0, 0, 0, AMQP_EMPTY_TABLE);
die_on_amqp_error(amqp_get_rpc_reply(conn), "Consuming");
{
diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h
index 7f4593f..40c8292 100644
--- a/librabbitmq/amqp.h
+++ b/librabbitmq/amqp.h
@@ -412,7 +412,6 @@ extern struct amqp_exchange_declare_ok_t_ *amqp_exchange_declare(amqp_connection
amqp_bytes_t type,
amqp_boolean_t passive,
amqp_boolean_t durable,
- amqp_boolean_t auto_delete,
amqp_table_t arguments);
extern struct amqp_queue_declare_ok_t_ *amqp_queue_declare(amqp_connection_state_t state,
@@ -441,7 +440,7 @@ extern struct amqp_queue_unbind_ok_t_ *amqp_queue_unbind(amqp_connection_state_t
amqp_channel_t channel,
amqp_bytes_t queue,
amqp_bytes_t exchange,
- amqp_bytes_t binding_key,
+ amqp_bytes_t routing_key,
amqp_table_t arguments);
extern struct amqp_basic_consume_ok_t_ *amqp_basic_consume(amqp_connection_state_t state,
@@ -450,7 +449,8 @@ extern struct amqp_basic_consume_ok_t_ *amqp_basic_consume(amqp_connection_state
amqp_bytes_t consumer_tag,
amqp_boolean_t no_local,
amqp_boolean_t no_ack,
- amqp_boolean_t exclusive);
+ amqp_boolean_t exclusive,
+ amqp_table_t filter);
extern int amqp_basic_ack(amqp_connection_state_t state,
amqp_channel_t channel,
diff --git a/librabbitmq/amqp_api.c b/librabbitmq/amqp_api.c
index 2b1ed54..b2793ff 100644
--- a/librabbitmq/amqp_api.c
+++ b/librabbitmq/amqp_api.c
@@ -196,13 +196,12 @@ amqp_exchange_declare_ok_t *amqp_exchange_declare(amqp_connection_state_t state,
amqp_bytes_t type,
amqp_boolean_t passive,
amqp_boolean_t durable,
- amqp_boolean_t auto_delete,
amqp_table_t arguments)
{
state->most_recent_api_result =
AMQP_SIMPLE_RPC(state, channel, EXCHANGE, DECLARE, DECLARE_OK,
amqp_exchange_declare_t,
- 0, exchange, type, passive, durable, auto_delete, 0, 0, arguments);
+ 0, exchange, type, passive, durable, 0, 0, 0, arguments);
return RPC_REPLY(amqp_exchange_declare_ok_t);
}
@@ -253,13 +252,13 @@ amqp_queue_unbind_ok_t *amqp_queue_unbind(amqp_connection_state_t state,
amqp_channel_t channel,
amqp_bytes_t queue,
amqp_bytes_t exchange,
- amqp_bytes_t binding_key,
+ amqp_bytes_t routing_key,
amqp_table_t arguments)
{
state->most_recent_api_result =
AMQP_SIMPLE_RPC(state, channel, QUEUE, UNBIND, UNBIND_OK,
amqp_queue_unbind_t,
- 0, queue, exchange, binding_key, arguments);
+ 0, queue, exchange, routing_key, arguments);
return RPC_REPLY(amqp_queue_unbind_ok_t);
}
@@ -269,12 +268,13 @@ amqp_basic_consume_ok_t *amqp_basic_consume(amqp_connection_state_t state,
amqp_bytes_t consumer_tag,
amqp_boolean_t no_local,
amqp_boolean_t no_ack,
- amqp_boolean_t exclusive)
+ amqp_boolean_t exclusive,
+ amqp_table_t filter)
{
state->most_recent_api_result =
AMQP_SIMPLE_RPC(state, channel, BASIC, CONSUME, CONSUME_OK,
amqp_basic_consume_t,
- 0, queue, consumer_tag, no_local, no_ack, exclusive, 0);
+ 0, queue, consumer_tag, no_local, no_ack, exclusive, 0, filter);
return RPC_REPLY(amqp_basic_consume_ok_t);
}
diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c
index d39f29d..13f6376 100644
--- a/librabbitmq/amqp_socket.c
+++ b/librabbitmq/amqp_socket.c
@@ -104,10 +104,10 @@ static char *header() {
header[1] = 'M';
header[2] = 'Q';
header[3] = 'P';
- header[4] = 1;
- header[5] = 1;
- header[6] = AMQP_PROTOCOL_VERSION_MAJOR;
- header[7] = AMQP_PROTOCOL_VERSION_MINOR;
+ header[4] = 0;
+ header[5] = AMQP_PROTOCOL_VERSION_MAJOR;
+ header[6] = AMQP_PROTOCOL_VERSION_MINOR;
+ header[7] = AMQP_PROTOCOL_VERSION_REVISION;
return header;
}
diff --git a/librabbitmq/codegen.py b/librabbitmq/codegen.py
index 6b38666..f911966 100644
--- a/librabbitmq/codegen.py
+++ b/librabbitmq/codegen.py
@@ -417,6 +417,7 @@ extern "C" {
"""
print "#define AMQP_PROTOCOL_VERSION_MAJOR %d" % (spec.major)
print "#define AMQP_PROTOCOL_VERSION_MINOR %d" % (spec.minor)
+ print "#define AMQP_PROTOCOL_VERSION_REVISION %d" % (spec.revision)
print "#define AMQP_PROTOCOL_PORT %d" % (spec.port)
for (c,v,cls) in spec.constants:
diff --git a/tools/consume.c b/tools/consume.c
index 943406b..34037d9 100644
--- a/tools/consume.c
+++ b/tools/consume.c
@@ -132,7 +132,7 @@ static void do_consume(amqp_connection_state_t conn, amqp_bytes_t queue,
int no_ack, const char * const *argv)
{
if (!amqp_basic_consume(conn, 1, queue, AMQP_EMPTY_BYTES, 0, no_ack,
- 0))
+ 0, AMQP_EMPTY_TABLE))
die_rpc(amqp_get_rpc_reply(conn), "basic.consume");
for (;;) {