-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Messenger with multiple AMQP nodes #35098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@xabbuh I see this feature request is tagged under Mailer, but it corresponds to Messenger. |
I've started working on it, but, finally think Symfony should not provide such configuration, because it's only supported by the php adapter, and an issue in amqp-extension suggest to use a haproxy in front of the cluster instead. Which is probably the better option. |
@jderusse That's what we've been using in the meantime. I've experienced no issues with HAproxy so far. Isn't the Redis component doing the same thing with respect to configuration options? Since Redis Sentinel is only available in Symfony if you have nrk/predis installed. |
@jderusse I also use HAProxy in front of my rabbit cluster (4 nodes) and I experience quite a lot of random "Library error: connection closed unexpectedly". |
Thank you for this suggestion. |
Yes please. |
Hi, Thank you |
Hi, Thank you |
Is anyone of you willing to give this a try? |
Interested AF |
Failover transport syntax is worth looking at in the context of this feature. |
Thank you for this suggestion. |
Yep, now it is impossible to work with a cluster without a haproxy |
Load balancing with HAProxy or similar does not make sense, I guess. The same way it would not make sense to simply load balance across a redis cluster. That's because you establish a connection with a node. And the client library probably expects to reach the same node when sending data. Otherwise, you send some data to a node with which you have not established a connection yet and authenticated and so on. Hence, we see errors like mentioned by @DamienHarper:
|
Thank you for this suggestion. |
Yes please. |
Thank you for this suggestion. |
Still yes |
Thank you for this suggestion. |
Yes |
Well, someone needs to provide the PR for it. The feature won't appear magically on its own. |
Thank you for this suggestion. |
Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3 |
@carsonbot Yes, this is still a missing feature. |
@freswa Would you like to contribute it? |
@xabbuh Not within weeks, but when work settles a bit, why not? |
Thank you for this suggestion. |
Still interested and useful |
I am closing here as apparently in over four years nobody was interested enough to contribute this feature. |
Description
I have a RabbitMQ cluster with multiple nodes. In order to have redundancy the application needs to be able to connect to all of the nodes. As of now, Symfony Messenger does not allow you to specify more than one node. Right now we "solve" the problem by using HAProxy. It would be better if Symfony allowed you to specify all of the nodes in the DSN.
Proposal
The default AMQP extension of PHP does not allow you to specify multiple nodes (as far as I'm concerned). The library php-amqplib allows you to do this with its
AMQPStreamConnection
class. Like this:I propose something similar as how Symfony uses Redis Sentinel. To use Redis Sentinel you need the Predis library and you can specify your DSN as follows:
redis:?host[redis1:26379]&host[redis2:26379]&host[redis3:26379]&redis_sentinel=mymaster
Then for AMQP you would specify the DSN as follows:
amqp:?host[node1:5672]&host[node2:5672]&host[node3:5672]
The text was updated successfully, but these errors were encountered: