redis / lettuce

Advanced Java Redis client for thread-safe sync, async, and reactive usage. Supports Cluster, Sentinel, Pipelining, and codecs.
https://lettuce.io
MIT License
5.36k stars 960 forks source link

4.3.0 Final can not connect with Azure Redis Cache #428

Closed xchen0012 closed 7 years ago

xchen0012 commented 7 years ago

I wrote a simple program main function to connect with Azure Redis cache using Lettuce 4.3.0 Final. I set a key value pair but i got this error:

com.lambdaworks.redis.RedisCommandTimeoutException: Command timed out
        at com.lambdaworks.redis.LettuceFutures.await(LettuceFutures.java:113)
        at com.lambdaworks.redis.LettuceFutures.awaitOrCancel(LettuceFutures.java:92)
        at com.lambdaworks.redis.FutureSyncInvocationHandler.handleInvocation(FutureSyncInvocationHandler.java:63)
        at com.lambdaworks.redis.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80)
        at com.sun.proxy.$Proxy0.set(Unknown Source)
        at com.microsoft.support.datapipeline.common.adapter.Implement.AzureRedisCache.setString(AzureRedisCache.scala:146)
        at com.microsoft.support.datapipeline.common.adapter.program$.main(program.scala:17)
        at com.microsoft.support.datapipeline.common.adapter.program.main(program.scala)
com.lambdaworks.redis.RedisCommandTimeoutException: Command timed out
        at com.lambdaworks.redis.LettuceFutures.await(LettuceFutures.java:113)
        at com.lambdaworks.redis.LettuceFutures.awaitOrCancel(LettuceFutures.java:92)
        at com.lambdaworks.redis.FutureSyncInvocationHandler.handleInvocation(FutureSyncInvocationHandler.java:63)
        at com.lambdaworks.redis.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80)
        at com.sun.proxy.$Proxy0.get(Unknown Source)
        at com.microsoft.support.datapipeline.common.adapter.Implement.AzureRedisCache.getString(AzureRedisCache.scala:176)
        at com.microsoft.support.datapipeline.common.adapter.program$.main(program.scala:18)
        at com.microsoft.support.datapipeline.common.adapter.program.main(program.scala)

When I switched it to 4.2.2 Final package, it can successfully set key value and get those value from keys.

mp911de commented 7 years ago

How do you connect to Azure Redis? Via SSL or plain-text? Do you use Redis Standalone or Redis Cluster?

xchen0012 commented 7 years ago

Yes. I used SSL and Redis Standalone client.

code: class AzureRedisCache(connectionInfo: ConnectionInfo) extends RedisCache{

private val redisClient= {

val password = connectionInfo.custom(ConnectionInfoConstants.AccessKey).toString
val hostName = connectionInfo.name
val port = connectionInfo.custom(ConnectionInfoConstants.Port).toString.toInt
val isSsl =  connectionInfo.custom(ConnectionInfoConstants.SSLPort).toString.toBoolean
val  redisUri = RedisURI.Builder.redis(hostName, port).withSsl(isSsl).withPassword(password).build()
RedisClient.create(redisUri)

} }

mp911de commented 7 years ago

You might want to enable DEBUG logging for com.lambdaworks.redis to get a debug log. Lettuce 4.3 is known to work with Azure Redis and Redis Cluster so the debug log should provide additional information.

xchen0012 commented 7 years ago

How can I enable DEBUG??

Thanks!!

mp911de commented 7 years ago

That's a setting in your logging framework.

mp911de commented 7 years ago

Any update on this issue?

mp911de commented 7 years ago

Closing this ticket because of inactivity.