rsmq-async-rs icon indicating copy to clipboard operation
rsmq-async-rs copied to clipboard

new_with_connection() expects type 'redis::aio::connection::Connection' which is deprecated

Open dinobenj opened this issue 1 year ago • 4 comments

new_with_connection() is unusable since redis::aio::connection::Connection is deprecated. Is there a way of adding tls to a redis connection without this function?

dinobenj avatar Oct 07 '24 16:10 dinobenj

I see. I will check what is the new way to do that and push a new version. Will do later after work.

DavidBM avatar Dec 17 '24 14:12 DavidBM

What version of the library are you using? Latest uses MultiplexedConnection.

Regardless, I updated to redis 0.27 and fixed a couple of breaking changes. I don't see any deprecation warning. So please, update to version 13.

DavidBM avatar Dec 22 '24 21:12 DavidBM

Gotcha. The main issue we were having is using an encrypted connection string(“rediss”). The connection just seemed to hang. It might be a skill issue on my part, but it seemed to affect all of our systems. Would you be able to check if you can connect via TLS?

dinobenj avatar Dec 22 '24 21:12 dinobenj

I didn't test it, but the crate supports to provide a redis connection.

So you should be able to build your own redis client with TLS and provide the connection when building the library.

Quick and dirty example:

let connection = redis::Client::build_with_tls(... params...).unwrap().get_multiplexed_async_connection().await.unwrap(); // This should give you the connection

let mut rsmq = Rsmq::new_with_connection(connection, false, None)
            .await
            .unwrap();

Here the docs of the build_with_tls function from redis: https://docs.rs/redis/latest/redis/struct.Client.html#method.build_with_tls

DavidBM avatar Dec 23 '24 21:12 DavidBM

I will close this one assuming it works for you. Please, feel free to reopen if not

DavidBM avatar Mar 18 '25 09:03 DavidBM