Skip to content

Failed when i try to set timeout #53

@josueLy

Description

@josueLy

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions