arobson / rabbot

Deprecated: Please see https://github.com/Foo-Foo-MQ/foo-foo-mq
MIT License
277 stars 129 forks source link

PubSub demo failure modes #90

Closed ubershmekel closed 6 years ago

ubershmekel commented 7 years ago

The exchange is undefined.

/node_modules/rabbot/src/index.js:329
    var publishTimeout = options.timeout || exchange.publishTimeout || connection.publishTimeout || 500;
                                                    ^

TypeError: Cannot read property 'publishTimeout' of undefined

https://github.com/arobson/rabbot/blob/master/demo/pubsub/subscriber.js#L45

Supplying my own timeout caused the same issue to occur with replyTimeout. After supplying them both I get unhandled rejections and the unreachable event fires.

Now I know that unreachable was because I had the wrong vhost.

Then I fixed that and got

Potentially unhandled rejection [1] Error: Publish failed - no exchange wascally-pubsub-messages-x on connection default is defined. at Broker. (.../node_modules/rabbot/src/index.js:313:25)

Which I believe is caused by addExchange not being called. @arobson is rabbit.configure failing? It seems to be creating everything on the rabbit exchange's end, but the client is unaware.

arobson commented 6 years ago

@ubershmekel - I have tried to reproduce this with version 2 and no matter which order I start the publisher and subscriber, it still works. I can also kill the broker in the middle of the run and it will still work.

Maybe give the code in master a shot and see if you're still having issues?