Open MornSunWang opened 1 year ago
type key 看看返回内容
key 就是string类型啊,我实际传入的值是“wang”。在redis-cli中,可以通过:xpending wang sale - + 10 返结果。调用 setClient.XPending("wang", "sale", "-", "+", 10)就会报 Unexpected response type: MultiBulk (expecting Bulk) 错误,调用setClient.XPending("wang", "sale"),可以返回总数。我使用的版本号是:3.8.670,我希望能拿到未回复消息的明细
3.8.670是什么意思,提供一个重现的console app上传一下
static void Main(string[] args)
{
string conn = "127.0.0.1:6379,password=wwl_shian_2021";
CSRedisClient redisClient = new CSRedisClient(conn); //CSRedisCore NuGet包版本号:3.8.670
RedisHelper.Initialization(redisClient);
redisClient.XAdd("keyName", ("msg", "test1"));
redisClient.XGroupCreate("keyName", "group1");
redisClient.XAdd("keyName", ("msg", "test2"));
redisClient.XAdd("keyName", ("msg", "test3"));
redisClient.XReadGroup("group1", "consumer1", 1, 0, ("keyName", ">"));
var info1= redisClient.XPending("keyName", "group1"); //可以获取信息
//报错,CSRedis.RedisProtocolException:“Unexpected response type: MultiBulk (expecting Bulk)”
var info2 = redisClient.XPending("keyName", "group1","-","+",10);
}
哦哦,建议切换到 FreeRedis
使用方法setClient.XPending(key, groupName, "-", "+", 10)时, 报 Unexpected response type: MultiBulk (expecting Bulk) 错误