I have below code, what is the ideal way to return the value correctly from this method that uses reactive redis operations and is meant to serve as an common api to read a value from redis. I can write some whacky code to manage this but just wondering if there is a cool way that I may be missing, thanks for sharing.
public Object getObject(final String key, final String hash) { reactiveRedisCommands.hget(key , field ) //returns Mono<String> .subscribe( new Consumer<String>() { @Override public void accept(String value) { //String value is obtained here and converted to object as per type and any additional processing that is required } }); return null;// how to return correct value here}