【发布时间】:2018-11-23 05:11:49
【问题描述】:
我想使用 nodeJs 通过 amqplib assert a queue in lazy mode into existence。
我知道我可以通过创建策略来做到这一点,我不想这样做,因为目前在我们拥有的环境中很难实现自动化。
我尝试了以下方法:
let options = {
durable: true,
arguments: {},
lazy: true, //doesnt work
mode: "lazy" //doesnt work
};
if (job.highQueueLengthExpected) {
options.arguments["x-queue-mode"] = "lazy"; //doesnt work
options.arguments["queue-mode"] = "lazy"; //doesnt work
options["x-queue-mode"] = "lazy"; //doesnt work
}
return ch.assertQueue(job.key, options).then(function (ok) {
我是 checking the mode 通过 RabbitMQ 的 HTTP API 触发的队列
curl -u guest:guest 'localhost:15672/api/queues/{vhostName}/{queueName}'
对于我在声明队列时提供的所有选项,mode comes back as default
【问题讨论】:
标签: node.js rabbitmq node-amqplib