I would like some pointers of best practice. I need to wait for a binding to complete before polling for data through it, and much of this happens in parallell all the way back to the client. But if there is already a binding operation in progress, issuing another one will replace the callback.

If I would like to patch node-amqp to support a separate callback for each binding operation, how would I proceed?

有帮助吗?

解决方案

The short answer is that this is not possible in node-amqp. If you call bind on a queue that already has a binding operation in progress, the callback will be replaced. So only one callback will be called for concurrent bindings on the same queue, namely the last one passed.

For this reason, and others, I have switched to using amqp-coffee which handles the binding callback differently.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top