Symfony2.2 with RabbitMq bundleを使用して単純な AMQP パブリッシャー/コンシューマーをセットアップしようとしています。バンドル ページのドキュメントに従っています。
パブリッシャーは正常に動作し、rabbitMq の Web マネージャーでメッセージを確認できます。コマンドを使用してコンシューマを実行しようとすると
php app/console rabbitmq:consumer my.api
次のエラーが表示されます。
Call to undefined method My\ApiBundle\Service\ConsumerService::setRoutingKey() in /***/vendor/oldsound/rabbitmq-bundle/OldSound/RabbitMqBundle/Command/BaseConsumerCommand.php on line 91
私のセットアップ:
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>
私の質問は次のとおりです。構成またはコードの何が問題になっていますか?