SETHOOK: Problem with arguments: ERR invalid argument
Hello,
I have created via an Interface a new customer command:
@Command("SETHOOK ?0 ?1 NEARBY ?2 FENCE POINT ?3 ?4")
List<Object> setHookIntersect(String webHook, String addr, String key, double Lon, double Lat);
Then i try to call it, see the example below, but I get each time an exception (see below):
List<Object> xyz = commands.setHookIntersect("myHook", "http://127.0.0.1:1001", "fleet", 89.050032, 32.102624);
Exception in thread "main" io.lettuce.core.RedisCommandExecutionException: ERR invalid argument '89.050032'
at io.lettuce.core.LettuceFutures.awaitAll(LettuceFutures.java:85)
at io.lettuce.core.LettuceFutures.awaitAll(LettuceFutures.java:46)
at io.lettuce.core.dynamic.AsyncExecutableCommand.dispatchCommand(AsyncExecutableCommand.java:81)
at io.lettuce.core.dynamic.AsyncExecutableCommand.execute(AsyncExecutableCommand.java:53)
at io.lettuce.core.dynamic.RedisCommandFactory$CommandFactoryExecutorMethodInterceptor.invoke(RedisCommandFactory.java:227)
at io.lettuce.core.dynamic.intercept.MethodInterceptorChain$MethodInterceptorContext.proceed(MethodInterceptorChain.java:117)
at io.lettuce.core.dynamic.intercept.MethodInterceptorChain$PooledMethodInvocation.proceed(MethodInterceptorChain.java:194)
at io.lettuce.core.dynamic.intercept.DefaultMethodInvokingInterceptor.invoke(DefaultMethodInvokingInterceptor.java:45)
at io.lettuce.core.dynamic.intercept.MethodInterceptorChain$MethodInterceptorContext.proceed(MethodInterceptorChain.java:117)
at io.lettuce.core.dynamic.intercept.MethodInterceptorChain.invoke(MethodInterceptorChain.java:79)
at io.lettuce.core.dynamic.intercept.InvocationProxyFactory$InterceptorChainInvocationHandler.handleInvocation(InvocationProxyFactory.java:101)
at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80)
Could anybody tell me what is the Problem? thanks
FYI: I use Java: lettuce as client
Hi @robmir44,
It looks like you are missing a param. It should be something like:
SETHOOK myHook http://127.0.0.1:1001 NEARBY fleet FENCE POINT 89.050032 32.102624 5000
Where the 5000 represents the radius in meters around the point.
Hello, Thanks for the answer. Now it is working, but what did i do?
- I changed from Java to python
redis_client = redis.StrictRedis(host, port, db)
data = redis_client.execute_command('custom redis command')
- My mistake was to use the docker-container and then I called the server (docker-container) with the localhost address (127.0.0.1), I mean with the call: SETHOOK(xxxx).
My problem is similar but with OBJECT or HAST SETHOOK myHook http://127.0.0.1:1001 NEARBY fleet FENCE HAST xxxxxx
ERR invalid argument 'HAST'
@hmunoz do you mean HASH? HAST is not a valid keyword.