title: How to inject RabbitMqBundle producer into service?
body: <p>I have a problem with injecting RabbitMq producer from <a href="https://github.com/php-amqplib/RabbitMqBundle" rel="nofollow noreferrer">RabbitMqBundle</a> into my service. </p>
  
  <p>Service:
      
  
  <pre><code>namespace App\Service;
  
  use Carbon\Carbon;
  use Doctrine\ORM\EntityManagerInterface;
  use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface;
  
  class RatingPositionRecalculateService
  {
  
      protected $entityManager;
  
      protected $positionProducer;
  
      public function __construct(EntityManagerInterface $entityManager, ProducerInterface $producer)
      {
          $this-&gt;entityManager = $entityManager;
          $this-&gt;positionProducer = $producer;
      }
  
      public function recalculate(Carbon $day)
      {
          // do stuff
      }
  
  }
  </code></pre>
  
  <p>old_sound_rabbit_mq.yml:</p>
  
  <pre><code>old_sound_rabbit_mq:
      connections:
          default:
              url: ''
  
      producers:
          rating_position:
              connection:       default
              exchange_options: { name: 'rating_position', type: direct }
  
      consumers:
          rating_position:
              connection:       default
              exchange_options: {name: 'rating_position', type: direct}
              queue_options:    {name: 'rating_position'}
              callback:         rating_position_service
  </code></pre>
  
  <p>and I get:</p>
  
  <pre><code>Cannot autowire service "App\Service\RatingPositionRecalculateService": argument "$producer" of method "__construct()" references interface "OldSound\RabbitMqBundle\RabbitMq\ProducerInterface" but no such service exists. You should maybe alias this interface to the existing "old_sound_rabbit_mq.rating_position_producer" service. Did you create a class that implements this interface?
  </code></pre>
  
  <p>I've tried wiring using services.yml:</p>
  
  <pre><code>rating_position_recalculate_service:
          class: App\Service\RatingPositionRecalculateService
          autowire: false
          arguments:
              $entityManager: '@doctrine.orm.entity_manager'
              $producer: '@old_sound_rabbit_mq.rating_position_producer'
  </code></pre>
  
  <p>but I still get the same exception. </p>