[英]Not receiving messages via azure service bus queue
I have a C# program sending messages to an Azure service Bus Q (on VM). 我有一个C#程序,将消息发送到Azure服务总线Q(在VM上)。 The messages should be received by a node.js application (on Mac).
消息应由 node.js应用程序(在Mac上)接收。 Problem is the receive.
问题是接收。 The behaviour I see is:
我看到的行为是:
I know that the C# program is correctly sending the message as I inspect with service bus explorer immediately after the program confirms "send". 我知道C#程序在确认“发送”后立即用服务总线资源管理器检查时正确地发送了消息。 The send is being done currently in synchronous mode.
当前正在同步模式下完成发送。
Node.js program: (running with latest azure library and node 8.9.4) Node.js程序:(与最新的Azure库和节点8.9.4一起运行)
logger.info("Connecting to service bus");
const sbService = azure.createServiceBusService(connectionString);
if (sbService != null) {
sbService.createQueueIfNotExists(queueName, function (err) {
if (err) {
logger.error("Cannot connect to "+queueName+" :: "+ util.inspect(err, { depth: null }));
} else {
logger.info("Connected to Q :: processing begins ");
var intervalID = setInterval(timerElapsed, 5000);
}
});
}
function timerElapsed() {
sbService.receiveQueueMessage(queueName, { isPeekLock: false }, function (err, lockedMessage) {
if (err) {
if (err !== 'No messages to receive') {
logger.error("receiveQueueMessage error states: "+ util.inspect(err, { depth: 2 }));
} else {
console.log('.');
}
} else {
logger.info("received Message: "+ util.inspect(lockedMessage, { depth: 2 }));
}
});
}
[EDIT] - Interestingly, I used the example from MS Github here github example with similar results. [编辑]-有趣的是,我使用了来自MS Github的示例,这里的github示例具有相似的结果。
< bangs head on table > Look at the clues in this post delays using python . < 桌上的刘海 >看这篇文章中使用python延迟的线索。 The culprit is queue partitioning which is on by default.
罪魁祸首是默认情况下启用的队列分区。 Turn it off, and voila...
关闭它,瞧...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.