Skip to content
Advertisement

Getting a key/keys from ReactiveRedisOperations always return empty result

I am migrating my traditional Redis cache to the Spring Data Reactive Redis. After migration I would like to test if my new integration works as expected but I faced a problem with getting key/keys from particular Redis Db, namely: My redisConfiguration class looks like this:

JavaScript

My “test” class looks like:

JavaScript

While getting key/keys I am always receiving empty Mono/Flux as a result like:

JavaScript

I am convinced that Redis is not empty and example key in Redis is whitelisting:ranomuser112

To be honest I am confused about what I am doing wrong and will be grateful for suggestions on how to get the particular key from reactive Redis. Cheers!

Advertisement

Answer

I overlooked the .subscribe() method call. Without it, the reactive result was ignored. The problem has been resolved.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement