diff options
author | Ask Solem <ask@celeryproject.org> | 2014-04-14 17:29:03 +0100 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2014-04-14 17:29:03 +0100 |
commit | be3000b4c84d7503f5ef4067de44ff16d060d158 (patch) | |
tree | fecacb0f149b067202c443b59aad3cc027a0ff1c /tools/consume.c | |
parent | dcb8edaccd6e164d624edfab0f3120d96f707f0a (diff) | |
parent | fe844e41ffad5691607982cbfe4054aacdcb81e0 (diff) | |
download | rabbitmq-c-github-ask-be3000b4c84d7503f5ef4067de44ff16d060d158.tar.gz |
Merge branch 'alanxz/master'
Conflicts:
Makefile.am
codegen
Diffstat (limited to 'tools/consume.c')
-rw-r--r-- | tools/consume.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/consume.c b/tools/consume.c index 9075302..5b7777e 100644 --- a/tools/consume.c +++ b/tools/consume.c @@ -75,7 +75,8 @@ static char *stringify_bytes(amqp_bytes_t bytes) static amqp_bytes_t setup_queue(amqp_connection_state_t conn, char *queue, char *exchange, - char *routing_key, int declare) + char *routing_key, int declare, + int exclusive) { amqp_bytes_t queue_bytes = cstring_bytes(queue); @@ -92,10 +93,10 @@ static amqp_bytes_t setup_queue(amqp_connection_state_t conn, exit(1); } - if (!queue || exchange || declare) { + if (!queue || exchange || declare || exclusive) { /* Declare the queue as auto-delete. */ amqp_queue_declare_ok_t *res = amqp_queue_declare(conn, 1, - queue_bytes, 0, 0, 1, 1, + queue_bytes, 0, 0, exclusive, 1, amqp_empty_table); if (!res) { die_rpc(amqp_get_rpc_reply(conn), "queue.declare"); @@ -193,6 +194,7 @@ int main(int argc, const char **argv) char *exchange = NULL; char *routing_key = NULL; int declare = 0; + int exclusive = 0; int no_ack = 0; int count = -1; amqp_bytes_t queue_bytes; @@ -213,7 +215,11 @@ int main(int argc, const char **argv) }, { "declare", 'd', POPT_ARG_NONE, &declare, 0, - "declare an exclusive queue", NULL + "declare an exclusive queue (deprecated, use --exclusive instead)", NULL + }, + { + "exclusive", 'x', POPT_ARG_NONE, &exclusive, 0, + "declare the queue as exclusive", NULL }, { "no-ack", 'A', POPT_ARG_NONE, &no_ack, 0, @@ -239,7 +245,7 @@ int main(int argc, const char **argv) } conn = make_connection(); - queue_bytes = setup_queue(conn, queue, exchange, routing_key, declare); + queue_bytes = setup_queue(conn, queue, exchange, routing_key, declare, exclusive); do_consume(conn, queue_bytes, no_ack, count, cmd_argv); close_connection(conn); return 0; |