From 90b8f3b398b6b413470d2f774e19091f3e5f2259 Mon Sep 17 00:00:00 2001 From: Alvaro Videla Date: Thu, 1 Dec 2011 00:18:55 +0100 Subject: [PATCH] new PHP scrip for ch3 --- php/chapter-3/rabbitmqctl-examples.php | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 php/chapter-3/rabbitmqctl-examples.php diff --git a/php/chapter-3/rabbitmqctl-examples.php b/php/chapter-3/rabbitmqctl-examples.php new file mode 100644 index 0000000..a77864f --- /dev/null +++ b/php/chapter-3/rabbitmqctl-examples.php @@ -0,0 +1,34 @@ +channel(); + +#/(rex.2) Declare the exchnage +$channel->exchange_declare('logs-exchange', + 'topic', false, true, false); + +#/(rex.3) Declare the queues +$channel->queue_declare('msg-inbox-errors', + false, true, false, false); + +$channel->queue_declare('msg-inbox-logs', + false, true, false, false); + +$channel->queue_declare('all-logs', false, + true, false, false); + +#/(rex.4) Bind the queues to the exchange +$channel->queue_bind('msg-inbox-errors', + 'logs-exchange', 'error.msg-inbox'); + +$channel->queue_bind('msg-inbox-logs', + 'logs-exchange', '*.msg-inbox'); +?> \ No newline at end of file