Closed SvenKratzEasel closed 11 months ago
What is happening there is that the username is "redis" and then it is inserting the password into the string.
Does the password contain characters like ":" or "@"?
I think I will change it, so it uses the redis ConnectionInfo
type directly rather than a string. So we can avoid problems with passwords with special characters
One thing you can do is to use the method new_with_connection
. So you can build the Redis connection using the Redis crate, and then pass it to the library. In that way you won't have any issue.
Btw, the preferred way to use it is to use the MultiplexedRsmq
. So you could do:
let conn_info = redis::ConnectionInfo {
addr: redis::ConnectionAddr::Tcp("host".to_string(), 1234),
redis: redis::RedisConnectionInfo {
db: 1,
username: Some("username".to_string()),
password: Some("password".to_string()),
},
};
let client = redis::Client::open(url)?;
let connection = client.get_multiplexed_async_connection().await?;
let mut options = RsmqOptions::default();
options.realtime = true; // or false, up to you
options.ns = "my ns"; //whatever your ns is, or let skip to use default ns
MultiplexedRsmq::new_with_connection(options, connection)
It would be similar if you use the normal facade, btw.
I see the interface isn't ideal. I will see if I can code some better functions tonight or tomorrow. Meanwhile, try that and let me know
Just updated the library to v6.0.0 which uses the internal types from redis to build the ConnectionInfo
so the password is passed as-is to the redis library. That should fix your issues.
Will close this issue. Feel free to reopen if you have any other issues.
Thanks, David, we'll try it out!
Hi we're having trouble connecting to our Redis instance, and we believe we've set all
RsmqOptions
correctly (e.g., hostname and password work when connecting manually via redis-cli). There might be a bug in the way the password is prefixed with "redis" innormal_facade.rs
(l24):Is prefixing "redis" a necessity? I think this is causing our authentication issue.