Skip to content

Add support for xClaimJustId [DATAREDIS-1226] #1799

@spring-projects-issues

Description

@spring-projects-issues

dengliming opened DATAREDIS-1226 and commented

Now luttuce already support xClaimJustId. but spring-data-redis still not support.

see:

public Flux<CommandResponse<XClaimCommand, Flux<RecordId>>> xClaimJustId(Publisher<XClaimCommand> commands) {

   if (true /* TODO: set the JUSTID flag */ ) {
      throw new UnsupportedOperationException("Lettuce does not support XCLAIM with JUSTID. (Ref: lettuce-io#1233)");
   }

   return connection.execute(cmd -> Flux.from(commands).map(command -> {

      String[] ids = command.getOptions().getIdsAsStringArray();
      io.lettuce.core.Consumer<ByteBuffer> from = io.lettuce.core.Consumer
            .from(ByteUtils.getByteBuffer(command.getGroupName()), ByteUtils.getByteBuffer(command.getNewOwner()));
      XClaimArgs args = StreamConverters.toXClaimArgs(command.getOptions());

      Flux<RecordId> result = cmd.xclaim(command.getKey(), from, args, ids).map(it -> RecordId.of(it.getId()));
      return new CommandResponse<>(command, result);
   }));
}

Referenced from: pull request #567

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions