-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
symfony/messager: how to set-up Redis transport connection by the socket? #34682
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
Sounds good to me. Up for a PR? |
@chalasr I am drastically interested in figuring it out. I totally got the problem and feature. Likewise, what way should I follow? |
Seems that "DSN" (Data source name aka "connection string") is not a specified format with a RFC behind it. To come up with such a format is quite some effort. Or even if you take the a format that already exist there is still the problem of parsing it correctly. Maybe better to rename the |
Yes, I could check if it's a valid file on the system but how can it connect by using socket file on rest of the code? |
It depends on the underlying driver ... for example this driver https://github.com/phpredis/phpredis#example-1 |
The Cache component handles such DSNs (Lock does probably as well, I didn't check), doing the same for Messenger seems consistent. |
Perhaps there is an opportunity here to avoid some duplication of code in these two files https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Cache/Traits/RedisTrait.php |
T 8000 he Lock component use an already connected Redis client. Basically to resolve it we need, use this part of RedisTrait (The scheme part are util?) to avoid error the error of parse_url:
And if we are this case, use the 'path' value (of parse_rul) and avoid to pass the port to method Redis::connect. |
So I have push a little too fast, this issue have to be fix on master (feature)? |
This PR was squashed before being merged into the 5.1-dev branch (closes #35295). Discussion ---------- [Messenger] Messenger redis local sock dsn | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #34682 | License | MIT | Doc PR | symfony/symfony-docs#12924 Enable connection by unix socket to Redis. ``` messenger.yaml framework: messenger: transports: async: "redis:///var/run/redis/redis.sock" ``` Commits ------- 0421e01 [Messenger] Messenger redis local sock dsn
Thanks! |
Uh oh!
There was an error while loading. Please reload this page.
I need to set-up connection to the Redis service by the socket. How to set-up DSN?
By the code allows only DSN with valid url Connection.php:
So DSN like "redis:///var/run/redis/redis.sock" is invalid.
Is there any reason for that or is it an architectural flaw?
The text was updated successfully, but these errors were encountered: