|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-10-26 02:08 UTC] pdezwart@php.net
[2011-10-26 02:08 UTC] pdezwart@php.net
-Status: Open
+Status: Wont fix
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 22:00:01 2025 UTC |
Description: ------------ it's unable to publish a message into the default exchange. // if i use $ex = new AMQPExchange($cnn); $ex->declare(''); // or $ex->bind($QUEUE_NAME, $QUEUE_NAME); i get "Server channel error: 403, message: ACCESS_REFUSED - operation not permitted on the default exchange" // if i publish a message $ex->publish('hello world!', $QUEUE_NAME); i get "Could not publish to exchange. Exchange name not set." how could i deal with that issue? Reproduce code: --------------- <?php try { $cnn = new AMQPConnection(); $cnn->connect(); $QUEUE_NAME = 'hello'; // Create a new queue $q = new AMQPQueue($cnn, AMQP_DURABLE); $q->declare($QUEUE_NAME); // Declare a new exchange $ex = new AMQPExchange($cnn); //$ex->declare(''); // Bind it on the exchange to routing.key //$ex->bind($QUEUE_NAME, $QUEUE_NAME); // Publish a message to the exchange with a routing key $ex->publish('hello world!', $QUEUE_NAME); // Read from the queue //var_dump($q->consume()); } catch (Exception $e) { echo $e->getMessage(), PHP_EOL; echo $e->getTraceAsString(), PHP_EOL; } Expected result: ---------------- everything should be fine, afaik ) Actual result: -------------- exception