Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用XPending方法报错 #481

Open
MornSunWang opened this issue Jul 20, 2023 · 5 comments
Open

使用XPending方法报错 #481

MornSunWang opened this issue Jul 20, 2023 · 5 comments

Comments

@MornSunWang
Copy link

使用方法setClient.XPending(key, groupName, "-", "+", 10)时,
报 Unexpected response type: MultiBulk (expecting Bulk) 错误

@2881099
Copy link
Owner

2881099 commented Jul 20, 2023

type key 看看返回内容

@MornSunWang
Copy link
Author

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,我希望能拿到未回复消息的明细

@2881099
Copy link
Owner

2881099 commented Jul 21, 2023

3.8.670是什么意思,提供一个重现的console app上传一下

@MornSunWang
Copy link
Author

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

@2881099
Copy link
Owner

2881099 commented Jul 21, 2023

哦哦,建议切换到 FreeRedis

https://github.com/2881099/FreeRedis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants