Skip to content

Getting io.vertx.core.impl.NoStackTraceThrowable: Cannot connect to any of the provided endpoints Error while trying to connect to redis in replication mode #401

@vasusethia1

Description

@vasusethia1

Version

I am facing issue for the redis version 4.4.0

Context

Getting io.vertx.core.impl.NoStackTraceThrowable: Cannot connect to any of the provided endpoints Error while trying to connect to redis in replication mode. I am defining a bean to return RedisApi. I am using aws redis

This is how I have configured my redis options

@Bean
public RedisAPI redisAPI() throws IOException {
		if(System.getenv("environment").equals("prod")){
			ConfigConstants.APPLICATION_JSON_PATH = "conf/application-prod.json";
		}
		if(configuration == null) configuration = new JsonObject(new String(Files.readAllBytes(Paths.get(ConfigConstants.APPLICATION_JSON_PATH))));
		List<String> serverList = (List<String>) configuration.getJsonObject("redisServer").getJsonArray("serverList")
				.getList();

		RedisOptions redisOptions = new RedisOptions()
				.setType(RedisClientType.REPLICATION)
				.setMaxWaitingHandlers(32)
				.addConnectionString("redis://ip.ng.0001.aps1.cache.amazonaws.com:6379")
				.addConnectionString("redis://ip2reader.ng.0001.aps1.cache.amazonaws.com:6379");

		Redis redisClient = Redis.createClient(vertx, redisOptions);
		return RedisAPI.api(redisClient);
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions