Vert.X Redis client HGETALL in MULTI throws error!

306 views
Skip to first unread message

Ashwin Surana

unread,
Mar 19, 2016, 12:18:34 PM3/19/16
to vert.x
Hello,
    I am a student applying for GSOC. While I was working on Vert.X redis client, I get error whenever I use client.hgetall() in a transaction (i.e. while using client.multi()). Here is my code below,


client = RedisClient.create(vertx, new RedisOptions().setAddress("127.0.0.1").setPort(6379));
client
.multi(multiEvent -> {
  client
.hgetall("hash1", hgetallEvent -> {
    client
.exec(execEvent -> System.out.println(execEvent.result()));
 
});
});

The exception thrown by this code is below. Also Is this the right way to write a multi transaction using Vert.X Redis client? If not, any guidance would be really helpful and appreciated. Thanks in advance :)!


Mar 19, 2016 9:18:58 PM io.vertx.core.impl.ContextImpl
SEVERE: Unhandled exception
java.lang.ClassCastException: java.lang.String cannot be cast to [Lio.vertx.redis.impl.Reply;
    at io.vertx.redis.impl.Reply.asType(Reply.java:124)
    at io.vertx.redis.impl.Reply.asType(Reply.java:156)
    at io.vertx.redis.impl.RedisConnection.handleReply(RedisConnection.java:376)
    at io.vertx.redis.impl.ReplyParser.handle(ReplyParser.java:180)
    at io.vertx.redis.impl.ReplyParser.handle(ReplyParser.java:21)
    at io.vertx.core.net.impl.NetSocketImpl.handleDataReceived(NetSocketImpl.java:313)
    at io.vertx.core.net.impl.VertxNetHandler.lambda$channelRead$30(VertxNetHandler.java:54)
    at io.vertx.core.impl.ContextImpl.lambda$wrapTask$18(ContextImpl.java:333)
    at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:225)
    at io.vertx.core.net.impl.VertxNetHandler.channelRead(VertxNetHandler.java:54)
    at io.vertx.core.net.impl.VertxNetHandler.channelRead(VertxNetHandler.java:31)
    at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:124)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
    at java.lang.Thread.run(Thread.java:745)

Paulo Lopes

unread,
Mar 19, 2016, 4:43:55 PM3/19/16
to vert.x
Hi,

Please add a issue in github, this is bug. When working with transactions commands only return at the end.

Ashwin Surana

unread,
Mar 19, 2016, 5:45:12 PM3/19/16
to vert.x
Hi,
  Thanks for replying. I have created an issue in github, below is the link to it.
   
   https://github.com/vert-x3/vertx-redis-client/issues/52

Thanks and Regards,
Ashwin Surana
Reply all
Reply to author
Forward
0 new messages