GCP Cloud Run with Spring Boot scenarios to Connect to Redis with Connection Refused scenarios
I'm working on a project and hit a roadblock. I'm deploying a Spring Boot application on Google Cloud Run, and I'm working with a `Connection refused` behavior when trying to connect to a Redis instance hosted on Google Cloud Memorystore. The Redis instance is set up in the same VPC as my Cloud Run service, and I'm using the Java Jedis client version 3.6.0. Despite being in the same region and having the correct firewall rules allowing ingress from the VPC, the connection fails. I've already tried configuring the Redis client with both the internal IP address and the hostname, but I continue to see the following behavior in my application logs: ``` org.springframework.data.redis.RedisConnectionException: Unable to connect to Redis server at x.x.x.x:6379; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not connect to Redis at x.x.x.x:6379: Connection refused ``` Here's the relevant snippet of my Spring configuration: ```java @Bean public RedisConnectionFactory redisConnectionFactory() { RedisStandaloneConfiguration config = new RedisStandaloneConfiguration("x.x.x.x", 6379); return new JedisConnectionFactory(config); } ``` I've also confirmed that my Cloud Run service has the necessary IAM permissions to access the Redis instance. Can anyone suggest what else I might be missing or if there are specific configuration settings I need to check for Cloud Run to communicate with Redis correctly? What would be the recommended way to handle this? What would be the recommended way to handle this?