redis / jedis

Redis Java client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

pratik-patil-polestar opened this issue · comments

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 behavior

I should retrieve the memory used by key-value in cache

Actual behavior

getting 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);
}

and i am using JedisPool from which i am taking a Jedis instance.

Redis / Jedis Configuration

Jedis version: 5.1.2

ElastiCache version: 7.1.0

Java version: 17

is it possible that this method is not allowed on AWS ElastiCache

@pratik-patil-polestar ask AWS ElastiCache.

thank you for using Jedis