Producer.publish() interface #657
-
Hi, I'm currently evaluating this bundle to replace some php-amqplib code which is much more verbose and more painful to maintain. I am really liking the declarative nature of this bundle. I'm only looking to use the producer part, not the consumer part at this stage. There's one thing that's irritating me. In RabbitMq/Producer.php, it declares:
Why is the second parameter declared with a default of an empty string? It makes sense that the default should be in configuration, like:
Weirdly, the code uses the exchange in the configuration, but there's no configuration to provide the routing key:
At this point I'm not really sure whether you're supposed to declare producers to be "per-exchange", "per-queue", or what. I would have thought that for each routing key you'd declare a producer, so that the specifics of the environmental setup of the MQ server can be abstracted away into the configuration file. In other words, I would have thought you could configure a producer to be "per-routing-key, per-exchange". If the authors would accept a pull request to change the default value of $routingKey in the publish() to be something like:
then update OldSoundRabbitMqExtension.php to take the additional configuration parameter; or provide feedback on a pull request I could submit which would provide a $routingKey parameter which provides a default parameter from configuration rather than hard coded, that would be great. Side note: We have all our RabbitMQ (including queue configuration) done centrally, so I've got auto_setup_fabric switched off. In reading the code, most of the options for producers are for declaring exchange, queues and bindings, as opposed to things that apply to the basic_publish() call to php-amqplib. Sorry for the long post, and thanks in advance for any direction provided. Nathan. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I've created pull request #658 to add the feature above. |
Beta Was this translation helpful? Give feedback.
I've created pull request #658 to add the feature above.