Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2206

"ERR unknown command 'memory', with args beginning with: USAGE" with Jedis and AWS ElastiCache

$
0
0

While using memoryUsage(key) method of Jedis i am getting this following error"errorMessage": "ERR unknown command 'memory', with args beginning with: USAGE"is it possible that this method is not allowed on AWS ElastiCache

Expected behaviorI should retrieve the memory used by key-value in cache

Actual behaviorgetting this error : "ERR unknown command 'memory', with args beginning with: USAGE"

Steps to reproduce:

public Long getValueSize(String hashKey, Jedis jedis) {  log.info("Request received to get memory usage from redis for key {}", hashKey);  byte[] serializeKey = kryo.serialize(hashKey);  return jedis.memoryUsage(serializeKey);}

i am using JedisPool from which i am taking a Jedis instance to perform this action.

Redis / Jedis ConfigurationJedis library version: 5.1.2ElastiCache version: 7.1.0Java version: 17

When i tried it locally with dockerized environment, where my java client was running as a lambda inside a docker container and redis instance was also running in a container at that time i am not getting such error and obtaining the expected result and on aws environment where i have ElastiCache instead of Redis i am getting this error as a response.

I believe it might be case that this particular method is not compatible with AWS ElastiCache but i am not sure of it as i am using it first time.

Thanks in advance :)


Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>