Discussion:
[rabbitmq-users] Connection Issue while closing channel in amqplib.
Pritam Upadhyay
2015-05-25 06:53:45 UTC
Permalink
Hello everyone,
I am developing a messaging application using Node.JS and RabbitMQ. I am
using *amqplib *library for connecting to RabbitMQ.
I have done whole pub/sub process successfully.But In the disconnect, when
I am trying to close the channel, it gives me following error.

Potentially unhandled rejection [1] Error: Channel ended, no reply will be
forthcoming
at rej (D:\Tools\nodejs\node_modules\amqplib\lib\channel.js:189:7)
at Channel.C._rejectPending (D:\Tools\nodejs\node_modules\amqplib\lib\
channel.js:191:28)
at Channel.C.toClosed (D:\Tools\nodejs\node_modules\amqplib\lib\channel.
js:159:8)
at Channel.accept (D:\Tools\nodejs\node_modules\amqplib\lib\channel.js:
178:12)
at Connection.mainAccept [as accept] (D:\Tools\nodejs\node_modules\
amqplib\lib\connection.js:62:33)
at Socket.go (D:\Tools\nodejs\node_modules\amqplib\lib\connection.js:465
:48)
at Socket.emit (events.js:104:17)
at emitReadable_ (_stream_readable.js:424:10)
at emitReadable (_stream_readable.js:418:7)
What i am doing at disconnect is.


*unbind_queue -> cancel_consumer -> delete_queue -> close_channel*
My understanding is, it is giving this error because channel is closed
before the *unbind_queue *event as *channel.unbindQueue(q,e,r)* takes few
milliseconds to unbind the queue from exchange.
So, my question is:

*Is there any way to do this following process in sync?*

*unbind_queue -> cancel_consumer -> delete_queue -> close_channel*

Thanks & Regards,
Pritam Upadhyay.
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michael Klishin
2015-05-25 09:19:55 UTC
Permalink
Post by Pritam Upadhyay
Is there any way to do this following process in sync?
unbind_queue -> cancel_consumer -> delete_queue -> close_channel
It's certainly possible with other clients :)

I suspect to do this in a more manageable manner you'd want to
look into the futures (promises) version of the API. 
--
MK

Staff Software Engineer, Pivotal/RabbitMQ
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Pritam Upadhyay
2015-05-25 09:25:03 UTC
Permalink
Yes i have seen docs of promise API for this client. but i couldn't get the
clear idea about this.

Please Can you be more specific in how to use it?
Post by Michael Klishin
Post by Pritam Upadhyay
Is there any way to do this following process in sync?
unbind_queue -> cancel_consumer -> delete_queue -> close_channel
It's certainly possible with other clients :)
I suspect to do this in a more manageable manner you'd want to
look into the futures (promises) version of the API.
--
MK
Staff Software Engineer, Pivotal/RabbitMQ
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+***@googlegroups.com.
To post to this group, send an email to rabbitmq-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...