Fix error: Class %old_sound_rabbit_mq.producer.class% does not exist from OldSoundRabbitMqExtension.php

huangapple go评论123阅读模式
英文:

Fix error: Class %old_sound_rabbit_mq.producer.class% does not exist from OldSoundRabbitMqExtension.php

问题

I'm here to help with the translation. Please let me know which specific parts you'd like me to translate.

英文:

I'm trying to execute symfony project with a rabbitmq plugin. The problem it's when i execute the command: php bin/console rabbitmq:consumer -m 50 activity-logs. The response is:

  1. OldSoundRabbitMqExtension.php line 677: Class %old_sound_rabbit_mq.producer.class% does not exist

I add the conexion info to services.yaml

  1. old_sound_rabbit_mq:
  2. connections:
  3. default:
  4. host: 'localhost'
  5. port: 5672
  6. user: 'user'
  7. password: 'pass'
  8. vhost: '/'
  9. lazy: false
  10. connection_timeout: 3
  11. read_write_timeout: 3
  12. # requires php-amqplib v2.4.1+ and PHP5.4+
  13. keepalive: false
  14. # requires php-amqplib v2.4.1+
  15. heartbeat: 0
  16. #requires php_sockets.dll
  17. use_socket: true # default false
  18. another:
  19. # A different (unused) connection defined by an URL. One can omit all parts,
  20. # except the scheme (amqp:). If both segment in the URL and a key value (see above)
  21. # are given the value from the URL takes precedence.
  22. # See https://www.rabbitmq.com/uri-spec.html on how to encode values.
  23. url: 'amqp://guest:password@localhost:5672/vhost?lazy=1&connection_timeout=6'
  24. producers:
  25. upload_picture: #this are ignored by the moment, only want the consumers
  26. connection: default
  27. exchange_options: {name: 'upload-picture', type: direct}
  28. service_alias: TestService # no alias by default
  29. default_routing_key: 'optional.routing.key' # defaults to '' if not set
  30. default_content_type: 'content/type' # defaults to 'text/plain'
  31. default_delivery_mode: 2 # optional. 1 means non-persistent, 2 means persistent. Defaults to "2".
  32. consumers: #here my consumers, that i really need
  33. activty_log:
  34. connection: default
  35. exchange_options: {name: 'la.1.activity.activity_to_save', type: direct}
  36. queue_options: {name: 'la.1.activity.activity_to_save'}
  37. callback: TestService #activity_log_service

And i had a dummy service to recipe the callback:

  1. <?php
  2. // src/Service/MessageGenerator.php
  3. namespace App\Service;
  4. class TestService
  5. {
  6. public function __construct(
  7. $entityManager,
  8. $producer
  9. ) {
  10. dd("hi constructor", $entityManager, $producer);
  11. }
  12. // ...
  13. public function testFunct(){
  14. dump("hello dummy!");
  15. }
  16. /*public function getConnectionParameters() {
  17. return array('vhost' => $this->getVhost());
  18. }*/
  19. }

I know that when the command execute the read of rabbitMq and services recipe the info from the queue messages. But look like that the message is wrong.

I test to insert the messages into the queue manually to read it, but the bug it's the same.

Any ideas? What could be?

答案1

得分: 0

问题出在配置中:

Fix error: Class %old_sound_rabbit_mq.producer.class% does not exist from OldSoundRabbitMqExtension.php

如果配置错误,我就不使用生产者,这会导致执行中断。

英文:

The problem was into the configuration:

Fix error: Class %old_sound_rabbit_mq.producer.class% does not exist from OldSoundRabbitMqExtension.php

how i don't use the producers, if you give wrong configuration broke the execution.

huangapple
  • 本文由 发表于 2023年5月22日 23:14:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76307614.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定