In the Symfony 2.7 application I'm developing I need to consume about RabbitMQ data. I install RabbitMQBundle and good, but when I try to consume I get the following error
[PhpAmqpLib\Exception\AMQPProtocolChannelException]
ACCESS_REFUSED - access to exchange 'options' in vhost '/' refused for user 'user'
config.yml:
old_sound_rabbit_mq:
connections:
default:
host: 'my-url'
port: 5672
user: 'user'
password: 'pass'
vhost: '/'
lazy: false
connection_timeout: 3
read_write_timeout: 3
# requires php-amqplib v2.4.1+ and PHP5.4+
keepalive: false
# requires php-amqplib v2.4.1+
heartbeat: 0
consumers:
read_node:
connection: default
exchange_options: { name: 'options', type: direct}
queue_options: { name: 'options' }
callback: process_node
services.yml:
services:
process_node:
class: AppBundle\Consumer\RabbitConsumer
RabbitConsumer.php
namespace AppBundle\Consumer;
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
use PhpAmqpLib\Message\AMQPMessage;
class RabbitConsumer implements ConsumerInterface{
public function execute(AMQPMessage $msg) {
return false;
}
}
console command:
php ./app/console rabbitmq:consumer read_node
I made a pure php script and working properly I hope someone can help me