Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

How to implement hmset in Lettuce Command Interface Commands

$
0
0

I am trying to invoke hmset command from Lettuce Command Interface CommandsBut at runtime it gives error

Command HMSET requires at least 3 parameters but method declares 2 parameter(s). Offending method: public abstract java.lang.Void net.media.max.utils.LettuceCommandInterface.hmset(java.lang.String,java.util.Map<java.lang.String, java.lang.String>)

below is my class

import java.util.Map;import io.lettuce.core.dynamic.Commands;import io.lettuce.core.dynamic.annotation.Command;import io.lettuce.core.dynamic.batch.BatchExecutor;import io.lettuce.core.dynamic.batch.BatchSize;@BatchSize(1000)public interface LettuceCommandInterface extends Commands, BatchExecutor {    @Command("HSET")    void hset(String key, String hashKey, String value);    @Command("ZADD")    void zadd(String key, double score, String member);    @Command("SET")    void set(String key, String values);    @Command("hmset")    Void hmset(String key, Map<String,String> map);}

If I replace the void with String as the return type then it gives the following error

Batching command method public abstract java.lang.String net.media.max.utils.LettuceCommandInterface.hmset(java.lang.String,java.util.Map<java.lang.String, java.lang.String>) must declare either a Future or void return type


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>