Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit af0a267

Browse files
feat(reactive): Support Lettuce
1 parent b7fb631 commit af0a267

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

‎src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveStreamCommands.java‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import io.lettuce.core.XAddArgs;
1919
import io.lettuce.core.XClaimArgs;
2020
import io.lettuce.core.XGroupCreateArgs;
21+
import io.lettuce.core.XPendingArgs;
2122
import io.lettuce.core.XReadArgs;
2223
import io.lettuce.core.XReadArgs.StreamOffset;
2324
import io.lettuce.core.cluster.api.reactive.RedisClusterReactiveCommands;
@@ -56,6 +57,7 @@
5657
* @author Tugdual Grall
5758
* @author Dengliming
5859
* @author Mark John Moreno
60+
* @author Jeonggyu Choi
5961
* @since 2.2
6062
*/
6163
class LettuceReactiveStreamCommands implements ReactiveStreamCommands {
@@ -235,9 +237,16 @@ public Flux<CommandResponse<PendingRecordsCommand, PendingMessages>> xPending(
235237
io.lettuce.core.Limit limit = command.isLimited() ? io.lettuce.core.Limit.from(command.getCount())
236238
: io.lettuce.core.Limit.unlimited();
237239

238-
Flux<PendingMessage> publisher = command.hasConsumer() ? cmd.xpending(command.getKey(),
239-
io.lettuce.core.Consumer.from(groupName, ByteUtils.getByteBuffer(command.getConsumerName())), range, limit)
240-
: cmd.xpending(command.getKey(), groupName, range, limit);
240+
XPendingArgs<ByteBuffer> xPendingArgs = XPendingArgs.Builder.xpending(groupName, range, limit);
241+
if (command.hasConsumer()) {
242+
io.lettuce.core.Consumer<ByteBuffer> consumer = io.lettuce.core.Consumer.from(groupName, ByteUtils.getByteBuffer(command.getConsumerName()));
243+
xPendingArgs.consumer(consumer);
244+
}
245+
if (command.hasIdle()) {
246+
xPendingArgs.idle(command.getIdle());
247+
}
248+
249+
Flux<PendingMessage> publisher = cmd.xpending(command.getKey(), xPendingArgs);
241250

242251
return publisher.collectList().map(it -> {
243252

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /