我想assert a queue in lazy mode into existence
通过 amqplib 使用 nodeJs。
我知道我可以通过创建策略来做到这一点,我不想这样做,因为它现在很难在我们拥有的环境中实现自动化。
我尝试了以下方法:
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