2018-04-27 15:01:50.141|ERROR|EvMessageListener|Receive MsgId:AC110006000D30F39991868BAA7BBF6B tag:1 status:ReconsumeLaterredis.clients.jedis.exceptions.JedisDataException: WRONGTYPE Operation against a key holding the wrong kind of valueat redis.clients.jedis.Protocol.processError(Protocol.java:117)at redis.clients.jedis.Protocol.process(Protocol.java:151)at redis.clients.jedis.Protocol.read(Protocol.java:205)at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)at redis.clients.jedis.Connection.getIntegerReply(Connection.java:222)at redis.clients.jedis.Jedis.hset(Jedis.java:606)at com.extracme.evready.busi.service.ServiceMessage.updateStakeRedisInfo(ServiceMessage.java:233)at com.extracme.evready.busi.service.ServiceMessage.handerMessage(ServiceMessage.java:139)at com.extracme.evready.busi.service.ServiceMessage$$FastClassBySpringCGLIB$$63c3ab5e.invoke(<generated>)at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)^Cat org.springframework.transaction.interceptor.T
/** * 2:控制模式 - 自動下發補償機制 狀態的有效時間 */String key_expire = RedisCarportCloumn.MODE_EXPIRE_PREFIX + result.getGridStakeSeq();//jedis.hset(key_expire,CommonConstant.SEND_TIMES_KEY, CommonConstant.SEND_STAKE_MSG_TIMES);//限制主動下發次數jedis.hset(key_expire,"SEND_TIMES","3");//限制主動下發次數//jedisCluster.hset(key_expire,CommonConstant.SEND_TIMES_KEY, CommonConstant.SEND_STAKE_MSG_TIMES);//限制主動下發次數}jedis.close();
hset看起來沒有實值型別不對的樣子。後來發現原來是因為redis資料庫中已經存在了相同的key, 而且key對應的實值型別並不是Hashkey;再調用hset時,就會拋出此錯誤。(ps:忽想起來,最初設定的key-val ,後面改為hash-val)
把原來的資料清掉,重新運行就沒問題了。