JavaNSQClient icon indicating copy to clipboard operation
JavaNSQClient copied to clipboard

Failed when i try to set timeout

Open josueLy opened this issue 3 years ago • 0 comments

I try to set the timeout of NSQConsumer but this throw a Cast Exception

NSQConfig config= new NSQConfig();
config.setMsgTimeout(Util.NSQ_MSG_TIMEOUT);
 NSQConsumer consumer = new NSQConsumer(lookup, topic, NsqChannelConst.REPORTS_CHANNEL, (message) -> {

//......

},config);

this is the error:

Caused by: java.lang.ClassCastException: class com.github.brainlag.nsq.frames.ErrorFrame cannot be cast to class com.github.brainlag.nsq.frames.ResponseFrame (com.github.brainlag.nsq.frames.ErrorFrame and com.github.brainlag.nsq.frames.ResponseFrame are in unnamed module of loader 'app') at com.github.brainlag.nsq.Connection.(Connection.java:77) ~[nsq-client-1.0.0.RC4.jar:na] at com.github.brainlag.nsq.NSQConsumer.createConnection(NSQConsumer.java:80) ~[nsq-client-1.0.0.RC4.jar:na] at com.github.brainlag.nsq.NSQConsumer.connect(NSQConsumer.java:210) ~[nsq-client-1.0.0.RC4.jar:na] at com.github.brainlag.nsq.NSQConsumer.start(NSQConsumer.java:72) ~[nsq-client-1.0.0.RC4.jar:na]

josueLy avatar Dec 09 '21 20:12 josueLy