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

decodeAsXPendingSummary NPE on r.get(1) or r.get(2) #45682

Open
roux-jerome opened this issue Jan 17, 2025 · 3 comments · May be fixed by #45687
Open

decodeAsXPendingSummary NPE on r.get(1) or r.get(2) #45682

roux-jerome opened this issue Jan 17, 2025 · 3 comments · May be fixed by #45687
Labels
area/redis kind/bug Something isn't working

Comments

@roux-jerome
Copy link

roux-jerome commented Jan 17, 2025

The xpending command can return null for lowest, hightest and consumer

https://github.com/quarkusio/quarkus/blob/main/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/ReactiveStreamCommandsImpl.java#L367-L381

@gsmet
Copy link
Member

gsmet commented Jan 17, 2025

/cc @Ladicek @cescoffier

@Ladicek Ladicek added kind/bug Something isn't working area/redis and removed triage/needs-triage labels Jan 17, 2025
Copy link

quarkus-bot bot commented Jan 17, 2025

/cc @cescoffier (redis), @machi1990 (redis)

@Ladicek
Copy link
Contributor

Ladicek commented Jan 17, 2025

The Redis documentation (https://redis.io/docs/latest/commands/xpending/) doesn't mention this, but after creating an empty stream and a consumer group, this is indeed possible:

127.0.0.1:6379> XADD mystream * name Sara surname OConnor
"1737123500546-0"
# has length 1
127.0.0.1:6379> XLEN mystream
(integer) 1
127.0.0.1:6379> XTRIM mystream MAXLEN 0
(integer) 1
# is empty now
127.0.0.1:6379> XLEN mystream
(integer) 0

127.0.0.1:6379> XGROUP CREATE mystream group55 0-0
OK

# this shows the `nil` values in the XPENDING response
127.0.0.1:6379> XPENDING mystream group55
1) (integer) 0
2) (nil)
3) (nil)
4) (nil)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redis kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants