I am running a simple rest app with redis
running in a docker container/docker-compose. I believe, redis
must be accessible to spring boot using http://redis:6379
. But, it throws the error:
018-07-22 21:53:33.972 ERROR 1 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool] with root cause
java.net.ConnectException: Connection refused (Connection refused)
My code is here.