quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.74k stars 2.67k forks source link

Redis client with AWS Elasticache #32159

Closed OmerShemesh closed 3 weeks ago

OmerShemesh commented 1 year ago

Describe the bug

I've created a redis cluster using AWS elasticache (with no cluster mode). The cluster contains a master and 2 replicas.

I'm building a Lambda using the quarkus-amazon-lambda extension as well as the quarkus-redis-client extension. I've configured my client to use this type: quarkus.redis.client-type=replication.

I've deployed my lambda and configured it to be in the same VPC as my Elasticache Redis cluster.

When invoking the lambda, I'm getting this error:

2023-03-27 13:50:25,852 WARN  [io.ver.red.cli.imp.RedisReplicationClient] (vert.x-eventloop-thread-1) Skipping failed node: 10.21.0.58: io.netty.channel.ConnectTimeoutException: connection timed out: /x.x.x.x:6379

The ip in the error(x.x.x.x) is outside of my VPC.

Turns out that Vertx RedisReplicationClient is using the info replication command that returns:

connected_slaves:2
slave0:ip=x.x.x.x.,port=6379,state=online,offset=5947958,lag=1
slave1:ip=y.y.y.y,port=6379,state=online,offset=5947958,lag=1

Where the ips from the command are indeed the ips from the error above.

This is clearly a problem with the Vertx client. I've tried to deploy a simple lambda using nodejs and the redis dependency and it worked as expected.

Expected behavior

A successful connection from the lambda to Elasticache.

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

quarkus-bot[bot] commented 1 year ago

/cc @cescoffier (redis), @gsmet (redis), @gwenneg (cache), @machi1990 (redis)

primozh commented 1 year ago

Possibly related to this one: https://github.com/vert-x3/vertx-redis-client/issues/343

cescoffier commented 3 months ago

Closing as https://github.com/vert-x3/vertx-redis-client/issues/343 has been fixed and integrated in Quarkus.

Please re-open it with a reproducer if you are still having the issue.

Ladicek commented 3 months ago

Let me reopen this, because https://github.com/vert-x3/vertx-redis-client/issues/343 has not been fixed in a Vert.x release yet. And when we do integrate it, we'll have to adjust the configuration model in Quarkus too. So the remaining work is small, but non-zero still.

cescoffier commented 3 months ago

My bad! I was thinking it was integrated