You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to close a channel directly, I get the following error:
Unhandled rejection TypeError: Cannot read property 'closeBecause' of undefined
at /home/dev/repos/ps-messaging-node/node_modules/amqplib/lib/channel_model.js:77:16
at tryCatcher (/home/dev/repos/ps-messaging-node/node_modules/bluebird/js/release/util.js:16:23)
at Function.Promise.fromNode.Promise.fromCallback (/home/dev/repos/ps-messaging-node/node_modules/bluebird/js/release/promise.js:179:30)
at Channel.C.close (/home/dev/repos/ps-messaging-node/node_modules/amqplib/lib/channel_model.js:76:18)
at Timeout.setTimeout (/home/dev/repos/ps-messaging-node/test.js:33:15)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
If I close the connection only, it works fine. Here is code to reproduce the error. As far as I can tell, calling connection.close will suit my needs, but the docs indicate that channel.close should still work, so I thought you might want to fix that.
'use strict'constamqp=require('amqplib')constusername='guest'constpassword='guest'consthost='localhost'constqueueName='test'constamqpUrl=`amqp://${username}:${password}@${host}`letconn,channelamqp.connect(amqpUrl).then(_conn=>{conn=_connreturnconn.createChannel()}).then(_channel=>{channel=_channelchannel.consume(queueName,(message)=>{console.log('got a message',message)})setTimeout(()=>{console.log('closing')// this works fine// conn.close()// .then(() => console.log('done closing'))// this causes an errorchannel.close().then(()=>conn.close()).then(()=>console.log('done closing'))},200)})
The text was updated successfully, but these errors were encountered:
When I try to close a channel directly, I get the following error:
If I close the connection only, it works fine. Here is code to reproduce the error. As far as I can tell, calling connection.close will suit my needs, but the docs indicate that channel.close should still work, so I thought you might want to fix that.
The text was updated successfully, but these errors were encountered: