Although I'm not quite sure why this particular set of code calls mup to "throw" like this, I found other reasons that might be related.
When using RabbitMQ (via Wascally ) my consumer handlers must be registered with
Fiber(()=>{ rabbit.handle(key, consumerFn) }).run()
... and inside consumeFn() I don't have a Meteor environment! There is no Meteor , and I do not have access to collections that could be defined in my application.
What I managed to do was use Meteor.bindEnvironment for my promise handler then , which was returned when I registered the handler. Using Meteor.bindEnvironment gives me access to all the things that I expect to have in my Meteor application.
Wascally.request(key, {content: 'my content'}) .then(Meteor.bindEnvironment((result)=>{ // now i have access to my Meteor environment and all collections }))
source share