i want to send and save some data in the rabbit; after a while that i run my code and after some sending data into my rabbit i get some error like this: Error: No channels left to allocate
i use from this code several times because i have several data to send into rabbitMQ
let open = require('amqplib').connect('amqp://localhost:5672')
open.then(function (conn) {
return conn.createChannel()
}).then(function (ch) {
return ch.assertQueue(q).then(function (ok) {
ch.sendToQueue(q, Buffer.from(JSON.stringify(data)))
return ch.close()
})
}).catch(console.warn)