Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consumerCount on disabled connection #28

Closed
ghost opened this issue Apr 16, 2015 · 5 comments
Closed

consumerCount on disabled connection #28

ghost opened this issue Apr 16, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 16, 2015

if i will call queue.consumerCount or queue.messageCount durning connection problems - it stops fire callbacks, even if connection will back later, is something remain closed?

idea to fix:

  • set flag to true on amqp ready event, and set to false on amqp close event
  • return specific error in consumerCount/messageCount callback if flag is not active
@barshow
Copy link
Contributor

barshow commented Apr 16, 2015

I can't repro this, I did do a small race fix that may help. Its also in #27

If you have repro steps or turn on debugging AMQP=3 DEBUG=* and send some logs ill have look.

@ghost
Copy link
Author

ghost commented Apr 17, 2015

  1. to stop receiving consumerCount after reconnect, try this:
connected to rabbit@Andreys-Air v3.5.0
queue "named-queue-test" created
message received: #1
try to get consumers count for queue...
consumers count: 1
message received: #2
try to get consumers count for queue...
consumers count: 1
message received: #3
try to get consumers count for queue...
consumers count: 1
message received: #4
connection is closed: 3634ms
try to get consumers count for queue...
try to get consumers count for queue...
try to get consumers count for queue...
try to get consumers count for queue...
connected to rabbit@Andreys-Air v3.5.0
message received: #5
try to get consumers count for queue...
message received: #6
try to get consumers count for queue...
message received: #7
try to get consumers count for queue...
message received: #8
try to get consumers count for queue...
message received: #9
  1. i get error during .consumerCount call on unnamed queue, but im not sure is it bug of protocol feature:
/Users/drago/Documents/amqp-coffee/bin/src/lib/Queue.js:133
        return cb(err, res.consumerCount);
                          ^
TypeError: Cannot read property 'consumerCount' of undefined
    at /Users/drago/Documents/amqp-coffee/bin/src/lib/Queue.js:133:27
    at /Users/drago/Documents/amqp-coffee/bin/src/lib/Queue.js:69:43
    at doneFn (/Users/drago/Documents/amqp-coffee/bin/src/lib/Channel.js:241:11)
    at TemporaryChannel.Channel._onChannelMethod (/Users/drago/Documents/amqp-coffee/bin/src/lib/Channel.js:336:71)
    at Connection._onMethod (/Users/drago/Documents/amqp-coffee/bin/src/lib/Connection.js:601:39)
    at AMQPParser.<anonymous> (/Users/drago/Documents/amqp-coffee/bin/src/lib/Connection.js:4:61)
    at AMQPParser.emit (events.js:118:17)
    at AMQPParser.parseMethodFrame (/Users/drago/Documents/amqp-coffee/bin/src/lib/AMQPParser.js:110:19)
    at AMQPParser.frameEnd (/Users/drago/Documents/amqp-coffee/bin/src/lib/AMQPParser.js:80:16)
    at AMQPParser.frame (/Users/drago/Documents/amqp-coffee/bin/src/lib/AMQPParser.js:63:21)

@barshow
Copy link
Contributor

barshow commented Apr 17, 2015

Thanks for that repro! Its fixed in #27 now and wrote some tests based on your repro.

@barshow
Copy link
Contributor

barshow commented Apr 17, 2015

its published to npm as 0.1.21-rc1 right now if you want to try it

@ghost
Copy link
Author

ghost commented Apr 18, 2015

cool, thank you
everything works

@ghost ghost closed this as completed Apr 18, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant