php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59761 can't use the default queue
Submitted: 2011-05-10 23:45 UTC Modified: 2011-10-26 02:08 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: hlopetz at gmail dot com Assigned:
Status: Wont fix Package: amqp (PECL)
PHP Version: 5.2.17 OS: 2.6.18-194.26.1.el5 x86_64 Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hlopetz at gmail dot com
New email:
PHP Version: OS:

 

 [2011-05-10 23:45 UTC] hlopetz at gmail dot com
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-26 02:08 UTC] pdezwart@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

It is my understanding that you cannot use blank exchange or queue names. If this is incorrect, please send me some documentation I can use that explains what the limitations are on names.

thanks!
 [2011-10-26 02:08 UTC] pdezwart@php.net
-Status: Open +Status: Wont fix
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC