Node JS无法在Redis中获取数据

时间:2020-11-09 14:44:36

标签: node.js spring spring-boot redis node-modules

我已经使用spring boot将数据保存在Redis中。使用以下代码:

@Cacheable(value="gsonMap",key = "#strCampCusrId")
public Map<String, Object> updateCustomerConfigInCache(String strCampCusrId, Map<String, Object> gsonMap) {
    logger.debug("Get from cache..."+strCampCusrId+" .. value : "+gsonMap);
    return gsonMap;
}

我已成功逐出java中的数据。

但是当我尝试获取节点中的数据时,我看到它无法识别相同的键并显示值为null。KeyName为 bayloruattesting



var redis = require('redis');
    const constants = require('./Constant.js');
    var client = redis.createClient(constants.redis_port, constants.redis_host); //creates a new client
    client.on('connect', function() {  
        console.log(' redis connected');
    });
    client.GET('bayloruattesting', (err, reply) => {
              
      console.log(reply);
    });
module.exports = client

请帮助!

0 个答案:

没有答案