symfony - Error when calling Rabbitmq consumer from command line -
i trying setup simple amqp publisher/consumer using symfony2.2 rabbitmq bundle, following documentation on bundle page
the publisher works fine, can see messages on web manager of rabbitmq. when try run consumer using command
php app/console rabbitmq:consumer my.api
i following error:
call undefined method my\apibundle\service\consumerservice::setroutingkey() in /***/vendor/oldsound/rabbitmq-bundle/oldsound/rabbitmqbundle/command/baseconsumercommand.php on line 91
my setup:
confi.yml
old_sound_rabbit_mq: connections: my.api: host: %amqp_host% port: %amqp_port% user: %amqp_user% password: %amqp_password% vhost: %amqp_vhost% producers: my.api: connection: my.api exchange_options: {name: 'my.api', type: fanout} consumers: my.api: connection: my.api exchange_options: {name: 'my.api', type: fanout} queue_options: {name: 'my.api'} callback: my.api
my\apibundle\service\consumerservice.php
namespace my\apibundle\service; use oldsound\rabbitmqbundle\rabbitmq\consumerinterface; class consumerservice implements consumerinterface { public function execute(\phpamqplib\message\amqpmessage $msg) { return false; } }
my\apibundle\resources\config\services.xml
<?xml version="1.0" encoding="utf-8"?> <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> <services> <service id="old_sound_rabbit_mq.my.api_consumer" class="my\apibundle\service\consumerservice"></service> </services> </container>
my question is: wrong config or code?
there no need register handler service - removing my\apibundle\resources\config\services.xml definition should solve problem.
Comments
Post a Comment