I am new to redis reactive implementation. I am trying to setup a backend which utilises redis on localhost:6379 (default location). Now the documentation stated "We do not need to add any code for configuration if want to connect to a Redis server at localhost:6379."
So i started my redis as usual:
made a simple post request
{"uid":"123","message":"hello world"}
to this controller
@PostMapping("/api/v1/space/post/")@ResponseBodypublic ResponseEntity<String> postMessage(@RequestBody Message message) throws Exception { if(messageService.postMessage(message.getUid(), message.getMessage())){ return ResponseEntity.ok("it works!"); } else{ return ResponseEntity.badRequest().body("something's wrong"); }}
Everything went fine, the log even stated that the hash has been created. But, when i do redis-cli and check for any keys, nothing is there.
I also tried to connect using LettuceConnectionFactory
@Beanpublic ReactiveRedisConnectionFactory reactiveRedisConnectionFactory() { return new LettuceConnectionFactory("localhost", 6379);}
Yet no luck, I am guessing that the spring boot is somehow connected to an embedded redis which is not what I want, so how do I connect to a redis instance?