0

I'm using quarkus, it has a reactive connection to redis. I need to add key-value-expiration. Due to the fact that this is reactive programming, I do not understand how to do this, please help.

there is an example, but it doesn't have an example of adding a key with a value: https://quarkus.io/guides/redis#creating-the-increment-service

ReactiveKeyCommands does not have an add, set, setex methods.

Арчи
  • 1
  • 2

1 Answers1

0
private final ReactiveValueCommands<String, String> valueCommands;

public ConstructorMyBean(ReactiveRedisDataSource reactive) {
        this.valueCommands = reactive.value(String.class, String.class);
}

valueCommands.setex("key", 90000, "value")
   .subscribeAsCompletionStage().thenApply(status-> "Successfully");

how stupid I am, but to be honest, before I asked, nothing worked

Арчи
  • 1
  • 2
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 21 '23 at 09:04