Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js NodeJS:Windows无法从Azure ServiceBus接收消息_Node.js_Windows_Message_Azureservicebus_Servicebus - Fatal编程技术网

Node.js NodeJS:Windows无法从Azure ServiceBus接收消息

Node.js NodeJS:Windows无法从Azure ServiceBus接收消息,node.js,windows,message,azureservicebus,servicebus,Node.js,Windows,Message,Azureservicebus,Servicebus,我以前使用过Linux docker和NodeJS脚本,可以成功地处理Azure ServiceBus消息 但是,现在我使用Windows docker/simple在Windows上运行,代码相同,即使我检查队列中是否有消息,仍会出现以下错误消息: 没有要接收的消息 参考代码: let azureSb = require('azure-sb'), connectionString = 'xxxxx', serviceBusService = azureSb.createServiceBusS

我以前使用过Linux docker和NodeJS脚本,可以成功地处理Azure ServiceBus消息

但是,现在我使用Windows docker/simple在Windows上运行,代码相同,即使我检查队列中是否有消息,仍会出现以下错误消息:

没有要接收的消息

参考代码:

let azureSb = require('azure-sb'), 
connectionString = 'xxxxx',
serviceBusService = azureSb.createServiceBusService(connectionString);

serviceBusService.receiveQueueMessage(PDF_PRINT_QUEUE, {isPeekLock: true}, (error, message) => {
    if (error) {
        console.log(error);
    }
    console.log('OK');
    ......
}
下面是我使用的主要NodeJS包:

# npm list --depth=0
+-- adal-node@0.2.1
+-- azure-keyvault@3.0.5
+-- azure-sb@0.11.1
+-- azure-storage@2.10.3
+-- http@0.0.0
+-- puppeteer@1.20.0
`-- puppeteer-core@1.20.0

我不认为这是azure sb库的问题,它似乎在windows中对我很好。但是,我建议使用基于AMQP的最新库,它的性能更好

我知道这是一个迟来的回复,但为了防止有人在旧的服务总线库中遇到问题并在这里登陆,请参考下面的链接

基于AMQP的@azure/service Bus7.0.0最新版本已经发布


你可以参考这个。嗨@joycai,我之前试着在Mac/Linux上运行时就已经遵循了那个文档。但现在我想在Windows上运行,但出现错误,无法从ServiceBus message QueueI获取消息,我使用azure进行了测试-sb@0.11.1这对我来说很有效,所以我想这不是代码问题。也许你可以试一下。