i am useing spring redisTemplate and redis scan
it works find in condition of single node.
but in cluster enviroment it could not work
i can't get a data.
is there way to get a scan data in clust enviroment?
here is my spring redisTemplate code.
//String key="products:aa";
//String key="products:aac";
//String key="products:ab";
//String key="products:ac";
String workKey="products:aa*";
ScanOptions options = ScanOptions.scanOptions().match(workKey).count(100).build();
ScanOptions options1 = ScanOptions.scanOptions().build();
RedisConnectionFactory factory = redisTemplate.getConnectionFactory();
RedisConnection conn = factory.getConnection();
Cursor<byte[]> cursor = conn.scan(options);
List<Product> result = new ArrayList<Product>();
while(cursor.hasNext()){
String key=new String((byte[]) cursor.next());
Product pa=getById(key.replace("products:",""));
result.add(pa);
}
//result
//String key="products:aa";
//String key="products:aac";